[Backgroundrb-devel] Mysql Server has gone away?

Ezra Zygmuntowicz ezmobius at gmail.com
Thu Jul 20 11:13:21 EDT 2006

On Jul 19, 2006, at 7:10 PM, robby at 1066propaganda.com wrote:

> 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 quickly and got the AJAX status stuff working (was REALLY
> pleasantly surprised with how easy that part was :).
> So everything is working great, until a couple hours later when  
> everything
> stops working. At first I couldn't figure it out. things would be  
> working
> great, and then not, no obvious error messages or anything. I was  
> able to
> track down an exception getting thrown:
> Mysql::Error: MySQL server has gone away:
> I searched through the list and through the rails site for any  
> reference
> to this being an issue. All I could find is some reference to this  
> being a
> problem in older versions of rails.
> Is anyone aware of a fix? I'm using the latest version of  
> BackgroundRB and
> rails v. 1.1, and I'm currently hosted on textdrive, if any of that is
> helpful.
> If there's any code that would be helpful to post I can do that  
> too, I'm
> just not sure what would be relevant.
> Thanks!

Hey Robby-

	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 and not in  
the plugin. Well you can do it in the plugin as well to keep it  
consistent. Then you need to restart the drb server. Give this a shot  
and see if it gets rid of your problem. Also I am curious about using  
this plugin on textdrive. Did they give you an extra port number to  
run it on? If you run into problems with running the drb server on a  
port then let me know and I can show you how to use a unix domain  
socket file instead so you don't take up an extra port.


More information about the Backgroundrb-devel mailing list