JobState
¶
A value describing the current state of a Job
enum class JobState {
IN_QUEUE,
RUNNING,
CANCELING,
SUCCESS,
FAILURE,
EXPIRED,
SUSPENDED,
}
Properties
IN_QUEUE
Any Job which is not yet ready
More specifically, this state should apply to any Job
for which all of the following holds:
The
Job
has been createdIt has never been in a final state
The number of
replicas
which are running is less than the requested amount
RUNNING
A Job where all the tasks are running
More specifically, this state should apply to any Job
for which all of the following holds:
All
replicas
of theJob
have been started
📝 NOTE: A Job
can be RUNNING
without actually being ready. For example, if a Job
exposes a web interface, then the web-interface doesn’t have to be available yet. That is, the server might
still be running its initialization code.
CANCELING
A Job which has been cancelled but has not yet terminated
📝 NOTE: This is only a temporary state. The Job
is expected to eventually transition to a final
state, typically the SUCCESS
state.
SUCCESS
A Job which has terminated without a _scheduler_ error
📝 NOTE: A Job
will complete successfully even if the user application exits with an unsuccessful
status code.
FAILURE
A Job which has terminated with a failure
📝 NOTE: A Job
should only fail if it is the scheduler’s fault
EXPIRED
A Job which has expired and was terminated as a result
This state should only be used if the timeAllocation
has expired. Any other
form of cancellation/termination should result in either SUCCESS
or FAILURE
.
SUSPENDED
A Job which might have previously run but is no longer running, this state is not final.
Unlike SUCCESS and FAILURE a Job can transition from this state to one of the active states again.