-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
delayed_job dies with database connection issues #10
Comments
Experiencing the same issue even when the db is on the same box. |
Try setting 'reconnect: true' in your database.yml for the appropriate environment; under Rails 2.3.x that should alleviate the problem. (I'm setting that up now myself, so I'll know for sure in a few days, but it makes sense.) |
"reconnect: true" works, but leads to problems with transactions, so I don't think that is a proper solution |
True, my use case was specific: the only database actions being done in the application were against the DJ table via DJ, so the issue with transactions was not relevant. You could still do it if your DJ database was on a separate connection from your normal DB, but that certainly becomes more complex to set up. |
Same issue with rails 3 beta4 .... Can't make it work. $ script/delayed_job start => SQL (111.9ms) UPDATE And when I start DJ with rake, every things working: $ rake jobs:work =>SQL (24.5ms) SHOW TABLES |
I'm seeing the same behavior with Rails 2.3.5 and the collectiveidea fork of delayed_job (version 2.0.3). When starting from script/delayed_job, it immediately dies with a "MySQL server has gone away" message, but when starting using the work:jobs rake task, it starts up properly. Rails application log logs this in conjunction with the failed startup: Delayed::Backend::ActiveRecord::Job Update (0.0ms) Mysql::Error: MySQL server has gone away: UPDATE |
Solution that I found somewhere on internet was to downgrade daemons gem (which is internal dependancy of DJ, I believe) from 1.1.0 to 1.0.10. That completely solved problems with dying delayed job. thank you, Anonymous! |
I've also experienced many "Mysql Server gone away errors" with activerecord. The fix was to increase the 'max_allowed_packet'. If the stacktrace for an error was too large mysql would terminate the connection. |
suckage, this is still an issue. I've always hated the daemons gem |
Are there any plans about this issue? |
Got this with ruby-oci8 and oracle-enhanced AR driver |
I also have this issue using ruby-oci8 and oracle-enhanced |
Running into this issue as well. |
+1 |
are there ways to retry upon database connection lost? |
Received this in our delayed_job.log... and then the DJ process dies. My best guess so far is there was a momentary network disruption between firewalls of our app and db networks.
<ActiveRecord::StatementInvalid: Mysql::Error: MySQL server has gone away: UPDATE
delayed_jobs
SET locked_by = null, locked_at = null WHERE (locked_by = 'delayed_job host:myhost pid:12345') >Would be nice if DJ had more robust connection handling... i.e. catch this issue, and retry the connection until it is successful... otherwise we have to write a script to restart DJ periodically, or detect when jobs in the queue are stale.
The text was updated successfully, but these errors were encountered: