Repository navigation
fix: Orchestrator - Respect pipeline run cancellation when the node flag is lost - #390
Open
grigoriipenkin-spec wants to merge 2 commits into
Open
grigoriipenkin-spec wants to merge 2 commits into
grigoriipenkin-spec wants to merge 2 commits into
Conversation
…lag is lost A status update from a stale session rewrites the whole ExecutionNode.extra_data and drops the desired_state flag that the cancel API had just committed. The running-execution sweep only read the node flag, so the container kept running after cancel returned success. The sweep now also checks the owning pipeline run's flag, which the orchestrator never rewrites. Refs Shopify/ml-infrastructure#1316
grigoriipenkin-spec
force-pushed
the
grigorii/1316-preserve-cancel-intent
branch
from
October 9, 2026 14:17
4b9a0d8 to
c62e2a3
Compare
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.
What
Cancel can be lost for an execution that is PENDING or RUNNING. The cancel API returns 200 but the container keeps running.
The running sweep now votes to terminate a node when the node flag or the flag of its pipeline run is
desired_state=TERMINATED.Why
terminate()commitsdesired_state=TERMINATEDinextra_dataof the run and its nodes. The orchestrator can hold an older copy of the node at the same time. When it sets a new status, the status history listener writes the wholeextra_datafrom that old copy and the node flag is gone. The running sweep only read the node flag, so it never terminated the container.The run flag is not touched by that write, so checking it too keeps the cancel.
Associated Issue
Shopify/ml-infrastructure#1316
Dev Notes
Tests