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

Preserve GoodJob::Jobs when a StandardError is raised #60

Closed
bensheldon opened this issue Jul 25, 2020 · 0 comments · Fixed by #62
Closed

Preserve GoodJob::Jobs when a StandardError is raised #60

bensheldon opened this issue Jul 25, 2020 · 0 comments · Fixed by #62
Labels
bug Something isn't working

Comments

@bensheldon
Copy link
Owner

bensheldon commented Jul 25, 2020

As uncovered in #59:

  • To be maximally safe by default, if someone has not configured ActiveJob correctly, jobs should be preserved if a StandardError bubbles up from GoodJob::Job#perform
  • ActionMailer::DeliveryJob does not inherit from ApplicationJob and is not covered by the documentation's advice to use retry_on

When a ~StandardError bubbles all the way up to the GoodJob adapter, the job will be discarded (marked as finished, or destroyed) the job will be preserved and re-run, unless GoodJob.standard_error_results_in_finished_job (maybe with more words-mithing 😅 ).

Your issue also triggered some more research and it seems that currently ActionMailer::MailDeliveryJob which is used when calling deliver_later on a Mailer) inherits from ActiveJob::Base which means that mailer errors may be incorrectly marked as finished/discarded.

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