Skip to content
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

Job exceptions not properly attached to good_jobs record #72

Closed
bensheldon opened this issue Aug 11, 2020 · 0 comments · Fixed by #79
Closed

Job exceptions not properly attached to good_jobs record #72

bensheldon opened this issue Aug 11, 2020 · 0 comments · Fixed by #79
Labels
bug Something isn't working

Comments

@bensheldon
Copy link
Owner

When there is an exception that is rescued by retry_on or discard_on, it is not consistently available to the GoodJob adapter as an argument, and does not always appear in the good_jobs.error column. This can happen if there are additional *_perform hooks that intercept the return value.

It seems like the only reliable way to access retry_on or discard_on (without monkey-patching them) is to use ActiveSupport::Instrumentation to hook into the events: https://guides.rubyonrails.org/active_support_instrumentation.html#retry-stopped-active-job

Unfortunately, this means having to pass those objects up through a global (like ActiveSupport::Current) and retrieved in the job processor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant