[Mongrel] Weird freeze problem

Luis Lavena luislavena at gmail.com
Thu Nov 8 07:50:44 EST 2007


On Nov 8, 2007 9:45 AM, Geoffrey Clements <baldmountain at gmail.com> wrote:
> Shouldn't the ActiveRecord database adapter recover from a lost connection
> and reconnect? I had a quick look at the source and the adapter has error
> messages for lost connections and code to reconnect, but it doesn't seem to
> be used anywhere in the adapter. (I only had a quick look in
> mysql_adapter.rb so it may be used somewhere else.)
>
> I'm not familiar enough with the code to try and fix it and don't have the
> time right now. Perhaps someone who is running into the issue can spare some
> time to fix it and pass the fix back to the ActiveRecord developers?
>

This issue arise from time to time on every list where ActiveRecord is
a topic :-P
(Named mongrel, merb, ruby-talk).

Ezra's suggestions posted a few days back on merb ml is handy:

Thread.new { loop { ActiveRecord::Base.verify_active_connections!;
sleep 60*60} }.priority = -10

I'm not fond by the big sleep, since I experienced bad results using
them. An alternative will be 1800.times { sleep 2 }

YMMV,

-- 
Luis Lavena
Multimedia systems
-
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi


More information about the Mongrel-users mailing list