Understand the River job state machine
masterRiver jobs transition through several states during their lifecycle. Understanding these states helps in debugging job flows and managing job lifecycles (e.g., retries, cancellations, and manual interventions).
Job States
Initial/Waiting States:
Available: The job is ready to be fetched and run.Scheduled: The job is waiting for a specific time to become available.Pending: The job is waiting for preconditions to be met or for a future schedule.
Intermediate States:
Running: The job is currently being executed by a worker.Retryable: The job encountered an error and is waiting for its next retry attempt.
Final States:
Completed: The job finished successfully.Cancelled: The job was explicitly cancelled.Discarded: The job failed too many times or was explicitly discarded.
Key Transitions
- Success/Failure: A
Runningjob moves toCompletedon success, orRetryableon error. If it exceeds error limits, it moves toDiscarded. - Retries: Jobs in
Retryable,Scheduled,Pending,Available,Running,Cancelled, orDiscardedstates can all be moved back toAvailablevia a manual retry. - Cancellations: Jobs in
Available,Running,Scheduled,Pending, orRetryablestates can be moved toCancelledvia a manual cancel. - Rescuing: A
Runningjob can berescuedinto eitherRetryableorDiscardedstates.