1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/test
John Hawthorn 5d9359bbc3 Use ActiveJob 5.2 retry logic for old jobs
Rails 6 introduces retries per-exception, instead of a global count of
retries. Because ActiveJob 5.2 doesn't serialize the execution count
per-exception, when ActiveJob 6.0 picks up an "old" job it can't know
the exception count in the new format.

This can also be an issue if AJ 6.0 serializes a new job with
exception_executions which is later picked up by AJ 5.2, which would
clear exception_executions (since it has no knowledge of it).

Previously we handled this by resetting exception_executions, if it
wasn't defined on a job, which could result in the worst case retrying
the job 2x the times we should.

This commit changes how we handle loading a legacy job: instead of
resetting exception_executions, we instead will always use the global
executions count.

This way, jobs which only have one retry_on (and didn't have a behaviour
change in AJ 6) are backwards-and-forwards-compatible with counts
respected exactly.

Jobs with multiple retry_on will revert to the AJ5.2 behaviour if they
were ever run under AJ5.2.
2019-04-22 14:53:38 -07:00
..
adapters Remove support for Qu gem. 2018-03-19 21:27:16 +01:00
cases Use ActiveJob 5.2 retry logic for old jobs 2019-04-22 14:53:38 -07:00
integration Enable Style/RedundantBegin cop to avoid newly adding redundant begin block 2018-12-21 06:12:42 +09:00
jobs Rewrite ActiveJob exception tests so it runs with the real adapters 2019-01-08 12:07:38 +01:00
models [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
support Respect ENV variables when finding DBs etc for the test suite 2019-02-06 01:20:06 +10:30
helper.rb Output junit format test report 2019-04-04 14:34:46 +09:00