-
-
Notifications
You must be signed in to change notification settings - Fork 523
Description
As described here hooking into perform_now is not enough to capture all exceptions that happen during execution of a job because retry logic is implemented as a rescue handler, which simply bypasses entire code flow from the perform_now.
It turned out we need to patch retry_job in order to be able to report exceptions on each retry but this is needed only up until Rails 8.0.2 (included). Luckily latest Rails' version of ActiveJob uses ActiveSupport.error.reporter to report an exception before retrying a job, which means we can provide our own error subscriber and no patching will be needed for Rails > 8.0.2 (not released in the moment of writing this but it's in main).
It turned out there's enqueue_retry.active_job that we can simply rely on for this.
Metadata
Metadata
Assignees
Labels
Projects
Status