From 95d9c3b3d6828b8ce37591e68d4239ce8c18460b Mon Sep 17 00:00:00 2001 From: Alberto Almagro Date: Fri, 23 Nov 2018 20:31:14 +0100 Subject: Keep executions for each specific exception (#34352) * Keep executions for each specific declaration Fixes #34337 ActiveJob used the global executions counter to control the number of times a job should be retried. The problem with this approach was that in case a job raised different exceptions during its executions they weren't retried the number of times defined by their `attemps` number. **Example:** Having the following job: ```ruby class BuggyJob < ActiveJob::Base retry_on CustomException, attemps: 3 retry_on OtherException, attempts: 3 end ``` If the job raised `CustomException` in the first two executions and then it raised `OtherException`, the job wasn't retried anymore because the global executions counter was already indicating 3 attempts. With this patch each `retry_on` declaration has its specific counter so that the first two executions that raise `CustomException` don't affect the retries count that future exceptions may have. * Revert "clarifies documentation around the attempts arugment to retry_on" This reverts commit 86aa8f8c5631f77ed9a208e5107003c01512133e. --- activejob/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activejob/CHANGELOG.md') diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md index e5cbff4a88..8e18faeb02 100644 --- a/activejob/CHANGELOG.md +++ b/activejob/CHANGELOG.md @@ -1,3 +1,10 @@ +* Keep executions for each specific declaration + + Each `retry_on` declaration has now its own specific executions counter. Before it was + shared between all executions of a job. + + *Alberto Almagro* + * Allow all assertion helpers that have a `only` and `except` keyword to accept Procs. -- cgit v1.2.3