max_attempts: Number that cannot go below 1. The amount of attempts the job can run after failing before giving up.
current_attempt: The current job attempt.
This changes the failure behavior, by putting the job into an intermediate FAILED_ATTEMPT state instead of the final FAILED state.
Once job fails, the attempt logic runs for the job, which either puts the job from FAILED_ATTEMPT state, to a final FAILED state, or back to the QUEUED state, incrementing the current_attempt field.
On failure between two atomic operations (job intermediate failure logic -> job retry logic), the server starts back up, and fetches all FAILED_ATTEMPT jobs, re-running the job retry logic.
semver-minor
Adds three fields to Job:
state: Job.FAILED_ATTEMPT
max_attempts
: Number that cannot go below 1. The amount of attempts the job can run after failing before giving up.current_attempt
: The current job attempt.This changes the failure behavior, by putting the job into an intermediate
FAILED_ATTEMPT
state instead of the finalFAILED
state.Once job fails, the attempt logic runs for the job, which either puts the job from
FAILED_ATTEMPT
state, to a finalFAILED
state, or back to theQUEUED
state, incrementing thecurrent_attempt
field.On failure between two atomic operations (job intermediate failure logic -> job retry logic), the server starts back up, and fetches all
FAILED_ATTEMPT
jobs, re-running the job retry logic.