fix: propagate abort phase to sub-actions and fix WatchActionDetails race#7200
Closed
AdilFayyaz wants to merge 2 commits intov2from
Closed
fix: propagate abort phase to sub-actions and fix WatchActionDetails race#7200AdilFayyaz wants to merge 2 commits intov2from
AdilFayyaz wants to merge 2 commits intov2from
Conversation
pingsutw
reviewed
Apr 16, 2026
| @@ -0,0 +1,19 @@ | |||
| # Claude Lessons Learned | |||
|
|
||
| // Cascade abort to non-terminal child actions so the reconciler terminates their pods. | ||
| // Skip SUCCEEDED and ABORTED rows — they are already done. | ||
| rows, err := r.db.QueryxContext(ctx, |
Member
There was a problem hiding this comment.
I think we can combine above query together
Comment on lines
+510
to
+516
| // A TaskAction deleted without a terminal condition was cascade-deleted by K8s | ||
| // (e.g. its parent was aborted). Treat it as aborted so the DB and UI reflect | ||
| // the real outcome instead of leaving the phase as UNSPECIFIED. | ||
| if eventType == watch.Deleted && phase == common.ActionPhase_ACTION_PHASE_UNSPECIFIED { | ||
| phase = common.ActionPhase_ACTION_PHASE_ABORTED | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
Suggested change
| // A TaskAction deleted without a terminal condition was cascade-deleted by K8s | |
| // (e.g. its parent was aborted). Treat it as aborted so the DB and UI reflect | |
| // the real outcome instead of leaving the phase as UNSPECIFIED. | |
| if eventType == watch.Deleted && phase == common.ActionPhase_ACTION_PHASE_UNSPECIFIED { | |
| phase = common.ActionPhase_ACTION_PHASE_ABORTED | |
| } | |
| if eventType == watch.Deleted { | |
| phase = common.ActionPhase_ACTION_PHASE_ABORTED | |
| } | |
| // Cascade ABORTED to all descendants of this action (recursive: children, | ||
| // grandchildren, etc.) that are not yet in a terminal phase. | ||
| // We use a recursive CTE so all depths are handled in a single round-trip. | ||
| rows, err := r.db.QueryxContext(ctx, |
pingsutw
reviewed
Apr 16, 2026
| if !ok { | ||
| return | ||
| } | ||
| c.dispatchEvent(taskAction, watch.Deleted) |
Member
There was a problem hiding this comment.
I'm thinking maybe we don't need it. we have inserted event in the run service, right?
Author
|
Handled correctly in: #7225 |
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.
Why are the changes needed?
Aborting a parent action left sub-actions and group members stuck on their previous phase in the UI. Two independent gaps — missing DB cascade and a notification race — prevented the ABORTED state from reaching clients.
What changes were proposed in this pull request?
How was this patch tested?
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link
main