I would like to propose an addition to the ActiveJob retry_on
API to allow the attempts
argument to be the symbol ‘:unlimited’ in addition to the specific number of retry attempts that it allows today.
The code change required would be minimal, likely only requiring changing the test in activejob/exceptions.rb
to see whether a retry should be called to if attempts == :unlimited || executions < attempts
.
It seems this would be most valuable when dealing with infrastructure issues that are expected to recover and the alternative would be taking manual intervention to re-enqueue the job once the issue is fixed. Presently, you could just choose an arbitrarily high number of allowed attempts but that seems somewhat artificial and inexpressive.