Return descriptive 409 for scaleStage on non-active jobs#863
Merged
Conversation
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]>
Test Results164 files ±0 164 suites ±0 11m 3s ⏱️ +34s For more details on these failures, see this check. Results for commit db34764. ± Comparison against base commit 0ec2673. |
james-lubin
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.