diff --git a/sky/jobs/state.py b/sky/jobs/state.py index 7cc103d6945..420a3adbd82 100644 --- a/sky/jobs/state.py +++ b/sky/jobs/state.py @@ -313,6 +313,8 @@ def failure_statuses(cls) -> List['ManagedJobStatus']: class ManagedJobScheduleState(enum.Enum): """Captures the state of the job from the scheduler's perspective. + A job that predates the introduction of the scheduler will be INVALID. + A newly created job will be INACTIVE. The following transitions are valid: - INACTIVE -> WAITING: The job is "submitted" to the scheduler, and its job controller can be started. @@ -342,6 +344,10 @@ class ManagedJobScheduleState(enum.Enum): briefly observe inconsistent states, like a job that just finished but hasn't yet transitioned to DONE. """ + # This job may have been created before scheduler was introduced in #4458. + # This state is not used by scheduler but just for backward compatibility. + # TODO(cooperc): remove this in v0.11.0 + INVALID = None # The job should be ignored by the scheduler. INACTIVE = 'INACTIVE' # The job is waiting to transition to LAUNCHING for the first time. The