-
Notifications
You must be signed in to change notification settings - Fork 283
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
Exception from Delayed::Job not reported if job fails to deserialize #472
Comments
@adamniedzielski do you know the reasons of the |
@jondeandres Thanks for your response! The |
Quick way to reproduce the problem: "abc".delay.first(->{})
Delayed::Worker.new.run(Delayed::Job.last) I think that now I understand why this gem uses In order to have a basic reporting for jobs which failed even before the first execution we would have to add something similar to: class RollbarPlugin < ::Delayed::Plugin
callbacks do |lifecycle|
lifecycle.around(:invoke_job, &Delayed::invoke_job_callback)
lifecycle.after(:failure) do |_, job|
::Rollbar.error("Delayed::Job ID=#{job.id} failed to execute") if job.attempts.zero?
end
end
end |
Hey @adamniedzielski, thanks for this, we'll try to release a new version with this soon. |
Thanks @richvorp! 💚 💯 🎉 |
Really hope to get this released asap, delayed job failure is high in a server under my monitor. |
If Delayed::Job fails to deserialize a job it throws
DeserializationError
. This happens early in the process and the hooklifecycle.around(:invoke_job, &Delayed::invoke_job_callback)
is not called.Looking at the code it is rescued here https://github.com/collectiveidea/delayed_job/blob/1e679174b513dc711f7d764c8bd9d4f5c6495276/lib/delayed/worker.rb#L235-L237 and the only hook it calls is "failure".
Do you have any idea how we can account correctly for this case?
The text was updated successfully, but these errors were encountered: