Comments (10)
Interesting, I can see why this would be a problem. Do you have thoughts on the best way for me to handle this case? How do I know a ActiveRecord::StatementInvalid
should be read as a SIGTERM?
from backburner.
Wow, thanks for the quick response.
I think if you trap the TERM, it won't be caught by rails and turned into StatementInvalid. So, borrowing from the stackoverflow thread I linked, if this were somewhere in the worker:
Signal.trap("TERM") do
Kernel.exit!
end
That would make it exit immediately. I thought about just throwing this into the worker and submitting a pull request, but the problem with this approach is that it terminates the worker in the middle of the job. I imagine the ideal behavior would be for the worker to only exit after the current job is finished processing, yes?
from backburner.
It actually doesn't really matter, if the job doesnt finish processing, it will eventually get auto released and then reprocessed by another worker in the future. So I think that's a non issue right?
from backburner.
Ah, true. I'm not yet accustomed to relying on the magic of beanstalkd :)
from backburner.
Yeah beanstalkd makes it really hard to lose jobs, you have to go out of your way :)
from backburner.
Can you try this from master and verify it works?
from backburner.
The above being said, I would want to have it finish processing the job eventually since if it's literally halfway through a complex job, it might redo some work twice if it doesn't get to finish. But I might tackle that as a separate issue.
from backburner.
Wow, that was fast :) we're using master now. this bug was very
intermittent so it's a little bit hard to say with certainty that the issue
is fixed, but it looks good!
Tyler Kiley
InQuicker, LLC
[email protected] | 770-597-9185
On Mon, Apr 22, 2013 at 10:03 PM, Nathan Esquenazi <[email protected]
wrote:
Can you try this from master and verify it works?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-16836640
.
from backburner.
Ok released 0.3.4 with this fix included. Thanks, hopefully that problem goes away.
from backburner.
@nesquena is there a means for gracefully shutting down (give worker's current job some time to finish and kill worker after it does)
Retrying a job that times out due to a worker being killed is not a big deal with idempotent jobs (or jobs whose side effects are guarded within a transaction), but for non-idempotent jobs (like sending an email or push notification) it'd be really nice to know there's little chance of a redeploy killing a worker in the time between when an e-mail was sent and when backburner notifies beanstalkd that the job was released/completed. Thanks for any insight and thanks for this awesome library (and rabl!)!
from backburner.
Related Issues (20)
- undefined method `tubes' for Backburner::Connection
- Queue settings aren't inherited from superclass
- Support retrying jobs without logging an exception HOT 1
- Job remains reserved when before_perform hook returns false
- Incompatible with foreman? HOT 2
- Possible to process jobs not enqueued with Backburner? HOT 1
- Travis builds failing HOT 4
- concurrent-ruby restrictive dependency HOT 2
- New release? HOT 1
- Datadog monitoring hooks
- Implement unix socket url
- ActiveJob based of backburner is restarting the job within HOT 2
- Difference with BeanEater HOT 1
- ThreadsOnFork not taking any job with a thread_number of 1 HOT 2
- Upgrading Beaneater to 1.1 makes job queues fail HOT 3
- Hook documentation is misleading about the ability to bury a job HOT 1
- NoMethodError (undefined method `queue_max_job_retries' for TestJob:Class) HOT 3
- Alternative ways to make workers work HOT 1
- Exception NoMethodError -> undefined method `ttr' for nil:NilClass HOT 1
- Replacing File.exists? with File.exist? as the former has been removed from ruby 2.7.7 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backburner.