Skip to content

Document that retry_on can't intercept process-death errors - #789

Open
wintan1418 wants to merge 1 commit into
rails:mainfrom
wintan1418:document-retry-on-limits-for-process-errors
Open

Document that retry_on can't intercept process-death errors#789
wintan1418 wants to merge 1 commit into
rails:mainfrom
wintan1418:document-retry-on-limits-for-process-errors

Conversation

@wintan1418

Copy link
Copy Markdown
Contributor

Fixes #786

retry_on / rescue_from only intercept exceptions raised while a job's perform runs. SolidQueue::Processes::ProcessPrunedError, ProcessExitError and ProcessMissingError are never raised inside the job — the process running it is already gone, and a different process (the one pruning registrations or the supervisor reaping a fork) records the error directly as a failed execution, after the fact. So there's no job execution left for Active Job's retry machinery to hook into, and retry_on silently does nothing for these errors.

As #786 points out (and #313 / #422 before it), this keeps surprising people coming from other backends, especially those running workers on preemptible/spot machines. This adds an explicit note to the "Jobs interrupted by non-graceful process death" README section explaining why retry_on can't work there, and pointing to the mechanisms that do: retrying manually via Mission Control, or automatically via the fail_many_claimed.solid_queue subscription documented just below the note.

Active Job's retry_on and rescue_from only hook into exceptions raised
while perform runs. ProcessPrunedError, ProcessExitError and
ProcessMissingError are never raised inside the job: the process running
it is already gone, and a different process records the error directly as
a failed execution after the fact. People coming from other backends
expect retry_on to cover this case and are surprised when it silently
doesn't, so spell out why it can't work and point to the mechanisms that
do: Mission Control and the fail_many_claimed subscription.

Fixes rails#786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retrying on SolidQueue::Processes errors doesn't work

1 participant