Skip to content

Commit 3451bc3

Browse files
committed
fix(radix): map Waiting/Active to STARTING; add Stopping/DeadlineExceeded
Radix's batch-job scheduler reports Waiting (image pull, pod scheduling) and Active (job resource created, pod not yet Running) before Running. Both were falling through to JobStatus.UNKNOWN, which is what users see for the first ~30-60s of a new job. - Waiting, Active -> STARTING - Stopping, Stopped -> FAILED ('Radix job was stopped') - DeadlineExceeded -> FAILED ('exceeded active deadline') - default arm now logs a warning with the unmapped status string and echoes it back in the message, so future gaps surface with the actual value instead of a generic 'unknown status code'.
1 parent 9122cbb commit 3451bc3

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

src/job_handler_plugins/radix/__init__.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,35 @@ def progress(self) -> Tuple[JobStatus, None | list[str] | str, None | float]:
7979
)
8080
result.raise_for_status()
8181
response_json = result.json()
82+
# Radix batch-job scheduler statuses:
83+
# Waiting - pod scheduled, pulling image / waiting for a node
84+
# Active - job resource created, first pod not yet Running
85+
# Running - container process is up
86+
# Succeeded - terminal, exit 0
87+
# Failed - terminal, non-zero exit or runtime failure
88+
# Stopping - kubectl delete in progress after a stop request
89+
# Stopped - terminated by an operator/user
90+
# DeadlineExceeded - killed because activeDeadlineSeconds elapsed
91+
# Anything else is a genuine surprise and stays UNKNOWN.
8292
match (response_json.get("status")):
8393
case "Running": # noqa
8494
return JobStatus.RUNNING, "Job is running", None
95+
case "Waiting" | "Active": # noqa - image pull / node scheduling
96+
return JobStatus.STARTING, "Radix job is starting (pod scheduling / image pull)", 0
8597
case "Failed": # noqa
8698
return (
8799
JobStatus.FAILED,
88100
"Job failed for an unknown reason. Consider implementing job progress update for more details.",
89101
0,
90102
)
103+
case "Stopping" | "Stopped": # noqa - operator-initiated termination
104+
return JobStatus.FAILED, "Radix job was stopped", 0
105+
case "DeadlineExceeded": # noqa
106+
return JobStatus.FAILED, "Radix job exceeded its active deadline", 0
91107
case "Succeeded": # noqa
92108
return JobStatus.COMPLETED, "Radix job completed successfully", 1
93109
case None:
94110
return JobStatus.STARTING, "Radix job is starting", 1
95-
case _:
96-
return JobStatus.UNKNOWN, "Radix returned an unknown status code", 0
111+
case unknown:
112+
logger.warning(f"Radix returned an unmapped job status: {unknown!r}")
113+
return JobStatus.UNKNOWN, f"Radix returned an unknown status: {unknown}", 0

0 commit comments

Comments
 (0)