similar to: Broken thread Safe connection Management on Mysql (Mysql too many connections errors)

Displaying 20 results from an estimated 3000 matches similar to: "Broken thread Safe connection Management on Mysql (Mysql too many connections errors)"

2005 May 08
1
ruby destructor hooks
Hi Is there a way of finding out when or whether the wx object referenced in ruby is still alive? Here''s my problem # register that +wx_control+ should update on application events of type +event_type+ def add_subscriber(wx_control, app_event_type) @subscriptions[app_event_type].push(wx_control) end # later def broadcast(app_event) @subscriptions[app_event.type].each { |
2006 Feb 20
0
Object Finalizers help
Heya guys, This one is bothering me as its evading my eye. I''m trying to set a callback on finalization of an object, ie: a finalizer set through a plugin to the model. Example In Plugin: def acts_as_goat class_eval do ObjectSpace.define_finalizer(self, Proc.new {self.conn.close} ) end end class UberGoat < ActiveRecord::Base acts_as_goat end Anyways, it seems to not
2006 Feb 20
1
Object finalization help
Heya guys, This one is bothering me as its evading my eye. I''m trying to set a callback on finalization of an object, ie: a finalizer set through a plugin to the model. Example In Plugin: def acts_as_goat class_eval do ObjectSpace.define_finalizer(self, lambda {self.conn.close} ) end end class UberGoat < ActiveRecord::Base acts_as_goat end Is this the correct way to set
2007 Jan 29
4
loading C extension in worker causes bus error on OS X only
In all likelihood, this doesn''t have anything to do with backgroundrb, but I''m stuck so I thought someone might be able to help. I have a pretty simple C extension that I built into a gem and have installed on my system. It works fine when required from rails (1.2.1). But when I have a Backgroundrb worker class use the extension (under os x), I get:
2007 Jan 04
10
Intermittent "can''t convert Float into Hash" and results.rb
Hi, I''m using backgroundrb 0.2.1 in a production environment and for most parts I''m very happy. We are using it to do some heavy video editing on the server side and it works great except that under, what seems heavy load the below problem happens intermittently. The problem has only happened 5 times out of over 500 runs by our backgroundrb worker. This is the code in our
2008 May 18
2
Pure win32-thread library?
Hi all, Here''s my initial stab at a pure Ruby win32-thread library that doesn''t work at all. I''m not sure how to pass the start address of the arguments to the callback. I thought about Marshal, but you can''t marshal a proc. BTW, the CreateThread method in windows-pr needs to be updated for this to have any hope of success. Any ideas? Thanks, Dan #
2007 Nov 16
1
Temporaly silencing the rails log.
Hi! I want to do what subject say. Is there any elegant way to do this: ??? # Silence the log inside the block attached to the method call. def silence_logger orig= nil ObjectSpace.each_object(::Logger) do |logger| logger.info "-" * 80 logger.info "Quieting the log..." orig= logger.level logger.level= ::Logger::FATAL end yield
2007 Mar 05
3
postgres barfage revisted
First of all, I''d like to do what I''ve seen several others here do: thank Ezra and any other contributors for producing a really great plugin. Even though I''m having some minor problems, this is all so approachable and easy to work with and dig into... I hate to think of the hoops you''d need to jump through (both as creator of such a system and as a user) to
2006 Jul 06
6
Mutex::Synchronize with backgroundrb
I have a question concerning where to use the synchronize function. The point of it is to put all of the code blacks passed to this function in a queue. This make sure that code gets ran one at a time. This is required when doing any kind of database activity in backgrondrb and multiple threads. Otherwise I lose the connection to my database. So here is my question: Do I need to do: @lock =
2006 Aug 01
4
Creating workers from workers?
Since MiddleMan is an uninitialized constant in a worker how do you create new workers inside a worker? Thank You, Ben Johnson E: bjohnson at contuitive.com O: 800-341-6826 M: 817-229-4258 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060731/75a77fa6/attachment-0001.html
2006 Aug 18
1
Ezra....allow_concurrency = false?
In a previous email you wrote this: Glad you''re getting some use out of the plugin ;) ActiveRecord does have some issues with threading and concurrency that can sometimes cause that error you are seeing. Open up your script/backgroundrb/ start file and comment out the following line: ActiveRecord::Base.allow_concurrency = true Make sure you do that up in your main app script folder
2006 Aug 07
1
:load_rails
if CONFIG[''load_rails''] ActiveRecord::Base.allow_concurrency = true ActiveRecord::Base.establish_connection(YAML.load(ERB.new(IO.read ("#{RAILS_ROOT}/#{CONFIG[''database_yml'']}")).result)[CONFIG[''environment'']]) end if i read the code right, this option doesnt really load rails. wouldnt it be better (for those who rely on the
2007 Jan 25
1
Link to possible code for symbolic chmod
I''m not sure if this is perfect, but it seems to work well for me so far. I haven''t tried to integrate it into Puppet because I''m still a bit new to Ruby. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/96956 Trevor _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com
2006 Jan 16
2
Curl help
I''ve been searching around for a curl implementation on ruby and havn''t had much luck. I have run into open-uri and Net::HTTP but they just arnt as robust as curl. The closest thing i found was this previous thread from July http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/149926 on using ruby-dl to load libcurl. Has anyone gotten any farther on this
2006 Aug 19
7
Impossible to get stable?
I have concluded that it is impossible to get this background process stable. I am out of ideas and could really use some help. Here is what I have: 50 workers, just running an infinite loop that constantly calls save! on a model. Keep in mind this is just for testing purposes. I catch all exceptions and put them in the log. I am tried setting allow_concurrency to true and false. Neither
2007 Dec 28
9
lost connection 2.0
I lost my "connection lost" error.. but now I''ve got a "Mysql::Error: MySQL server has gone away" error.. It comes from: /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract_adapter.rb:128:in ''log''. I''m not sure if Rails / BackgroundRb uses it .. but i''ve got the mysql (2.7) gem
2006 Jul 20
3
Mysql Server has gone away?
First off, amazing plugin! Being a rails noob, it helped me do some stuff I would''ve thought way over my head. Which brings me to my problem. :) I''m using backgroundrb to handle some processes that take so long that I don''t want them tied to a page refresh (several xml-rpc calls and saving data in text files on the server). I got it working with backgroundrb fairly
2006 Dec 07
7
shorewall and mrouted
Hi When I start shorewall, the multicast stream is stopped. My config: Windows VLC Client-----eth0:192.168.254.1/24--fw---eth1:191.168.254.254/16-------------------------Linux VLC Streaming server 192.168.254/24 lan wan (but it''s really a internal lan !) 191.168.1.21/16 on the FW/shorewall route add -net 224.0.0.0 netmask
2006 Aug 17
1
Worker pool worker for page scanners: lost connection to mysql
Hello, I want to scan many URLs simultaneously with a new scanner worker for each URL, but I keep getting Mysql::Error: Lost connection to MySQL. Yes, allow_concurrency=false. Each scanner thread needs access to my ActiveRecord models to store discovered feeds and whatnot. There is a DB table called page_scans that acts as a big queue holding URLs waiting to be scanned. It would be
2006 Aug 24
3
A new QueueWorker class
Hello all, I''ve come up w/ a worker class that manages queued jobs using a fixed number of child workers. Well, that''s not quite true -- a new worker is spawned for each job, but you set the total number that may exist at once. There are three components: 1) queue_worker.rb: The singleton worker that manages the child workers. You probably want to auto start this. Make sure you