Skip to content

Canceled background steps should not impact job result - #4482

Merged
lokesh755 merged 3 commits into
mainfrom
lokesh755-fix-cancel-steps-result
Jun 8, 2026
Merged

Canceled background steps should not impact job result#4482
lokesh755 merged 3 commits into
mainfrom
lokesh755-fix-cancel-steps-result

Conversation

@lokesh755

@lokesh755 lokesh755 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Canceled background steps should not impact the job result. A background step that is explicitly canceled by a cancel control step is expected to be canceled, so its Canceled result no longer influences the overall job result. A genuinely failed step still counts, even when it was targeted by a cancel (e.g. it failed before the cancellation took effect).

This also splits BackgroundStepCoordinator.WaitForUnwaitedStepsAsync into two members so each has a single responsibility:

  • WaitForUnwaitedStepsAsync — drains any unwaited background steps at the post-job boundary.
  • GetAggregatedResult() — folds the background step results into a single TaskResult for the caller.

Changes

  • Track explicitly-canceled step IDs (_explicitlyCanceledStepIds) so a Canceled outcome from a cancel step is skipped during result aggregation, while Failed outcomes still propagate.
  • Split WaitForUnwaitedStepsAsync (drain) from GetAggregatedResult() (aggregation); updated the StepsRunner call site to call both in sequence.

Copilot AI review requested due to automatic review settings June 8, 2026 19:37
@lokesh755
lokesh755 requested a review from a team as a code owner June 8, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts how background step results are folded into the overall job result so that background steps explicitly canceled via a cancel control step don’t cause the job to become Canceled, while genuine Failed outcomes still propagate. It also refactors background-step draining vs. result aggregation into two separate coordinator methods.

Changes:

  • Track explicitly-canceled background step IDs and ignore their Canceled outcome during background-result aggregation (while still propagating Failed).
  • Split background-step “drain” (WaitForUnwaitedStepsAsync) from “aggregate” (GetAggregatedResult) and update StepsRunner to call both.
  • Add L0 coverage for “canceled background step doesn’t affect job result” and “failed background step targeted by cancel still fails the job”.
Show a summary per file
File Description
src/Test/L0/Worker/BackgroundStepsL0.cs Adds new L0 tests validating aggregation semantics for explicitly-canceled vs. failed background steps.
src/Runner.Worker/StepsRunner.cs Updates the post-job safety-net flow to drain background steps first, then aggregate results separately.
src/Runner.Worker/BackgroundStepCoordinator.cs Introduces explicit-cancel tracking and separates draining from aggregation logic.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Comment thread src/Test/L0/Worker/BackgroundStepsL0.cs Outdated
Comment thread src/Test/L0/Worker/BackgroundStepsL0.cs
@lokesh755
lokesh755 force-pushed the lokesh755-fix-cancel-steps-result branch from 558b317 to ba1670a Compare June 8, 2026 20:50
Comment thread src/Runner.Worker/BackgroundStepCoordinator.cs
@lokesh755
lokesh755 merged commit 16c52e3 into main Jun 8, 2026
12 checks passed
@lokesh755
lokesh755 deleted the lokesh755-fix-cancel-steps-result branch June 8, 2026 21:18
@eeryngloriani-sudo

Copy link
Copy Markdown

Commit now

@eeryngloriani-sudo

Copy link
Copy Markdown

Successful to Quic Request

@eeryngloriani-sudo

Copy link
Copy Markdown

Change like datalog info 04/152026

@eeryngloriani-sudo

Copy link
Copy Markdown

Exit to all bad error. Request now done true

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.

4 participants