Skip to content

Return descriptive 409 for scaleStage on non-active jobs#863

Merged
Andyz26 merged 1 commit into
masterfrom
andyz/scaleConflictResponse
Jul 2, 2026
Merged

Return descriptive 409 for scaleStage on non-active jobs#863
Andyz26 merged 1 commit into
masterfrom
andyz/scaleConflictResponse

Conversation

@Andyz26

@Andyz26 Andyz26 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

When a job is stuck (e.g. its workers cannot start due to a runtime error such as a missing required parameter) or still in init state, as in a non-active behavior. A scaleStage request in that state previously got a generic "Unexpected message ScaleStageRequest{...} received by Job actor in State" rejection, which gave operators no signal about the real problem and forced them to dig through logs to find the underlying cause.

Add onScaleStageNonActive, wired into the initialized and terminating behaviors, which returns a 409 CLIENT_ERROR_CONFLICT whose message names the job's current state, e.g. "Cannot scale stage 1: job is in state Accepted and is not currently scalable". No workers are durably stored for a job that cannot be scaled.

Add JobScaleUpDownTests coverage for the stuck-in-Accepted and terminating cases.

When a job is stuck (e.g. its workers cannot start due to a runtime
error such as a missing required parameter) it never reaches the
Launched state, so it stays in a non-active behavior. A scaleStage
request in that state previously got a generic "Unexpected message
ScaleStageRequest{...} received by Job actor <id> in <state> State"
rejection, which gave operators no signal about the real problem and
forced them to dig through logs to find the underlying cause.

Add onScaleStageNonActive, wired into the initialized and terminating
behaviors, which returns a 409 CLIENT_ERROR_CONFLICT whose message names
the job's current state, e.g. "Cannot scale stage 1: job <id> is in
state Accepted and is not currently scalable". No workers are durably
stored for a job that cannot be scaled.

Add JobScaleUpDownTests coverage for the stuck-in-Accepted and
terminating cases.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@github-actions

Copy link
Copy Markdown

Test Results

164 files  ±0  164 suites  ±0   11m 3s ⏱️ +34s
797 tests +2  785 ✅ +1  11 💤 ±0  1 ❌ +1 
798 runs  +3  786 ✅ +2  11 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit db34764. ± Comparison against base commit 0ec2673.

@Andyz26 Andyz26 merged commit bc70c0a into master Jul 2, 2026
2 of 3 checks passed
@Andyz26 Andyz26 deleted the andyz/scaleConflictResponse branch July 2, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants