robby at 1066propaganda.com
2006-Jul-20 02:10 UTC
[Backgroundrb-devel] 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 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!
I had similar problem, removing concurrent line from ./script/backgroundrb/start may help... On 7/20/06, robby at 1066propaganda.com <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! > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-- nothing much to talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060720/77d9d750/attachment.html
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. Cheers- -Ezra
Looks like setting allow_concurrency to true did the trick. I''m having a few other server issues so it took me a while to verify, but yeah, all seems to be working now. Thanks so much for your quick response! >> 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. Well, I thought there might be an issue with TextDrive because they have a note about long running processes in there terms of use statement. But I emailed them about it specifically, and the response I got was basically "as long as you don''t put too much strain on anything, we don''t really mind." So I just started it up as normal, with rake backgroundrb:start and everything worked like it would on any other server (aside from the database timeouts). I didn''t have to ask for a port number or anything. The whole system still seems to be acting a little bit squirrelly though, so I''m not sure I''m totally in the clear yet. I just started getting a message about the nfs server not responding, and I hadn''t seen that before. But that just seems to be causing a lag, not an out- and-out breakage. Thanks again for being so helpful, I''m new to rails and so far the community has seemed really amazing. ----------------------------------------------------------- Robby Macdonell robby at 1066propaganda.com On Jul 20, 2006, at 11:13 AM, Ezra Zygmuntowicz wrote: 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. Cheers- -Ezra