Giter VIP home page Giter VIP logo

Comments (10)

nesquena avatar nesquena commented on June 3, 2024

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.

tkiley avatar tkiley commented on June 3, 2024

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.

nesquena avatar nesquena commented on June 3, 2024

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.

tkiley avatar tkiley commented on June 3, 2024

Ah, true. I'm not yet accustomed to relying on the magic of beanstalkd :)

from backburner.

nesquena avatar nesquena commented on June 3, 2024

Yeah beanstalkd makes it really hard to lose jobs, you have to go out of your way :)

from backburner.

nesquena avatar nesquena commented on June 3, 2024

Can you try this from master and verify it works?

from backburner.

nesquena avatar nesquena commented on June 3, 2024

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.

tkiley avatar tkiley commented on June 3, 2024

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.

nesquena avatar nesquena commented on June 3, 2024

Ok released 0.3.4 with this fix included. Thanks, hopefully that problem goes away.

from backburner.

KrisJordan avatar KrisJordan commented on June 3, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.