Skip to content

Report reason for cancellation of parallel task #1226

Description

@aucampia

When two tasks run in parallel, and one fails, the other seems to be cancelled, but this cancellation is not reported explicitly.

It would be significantly clearer to users what is happening if the reason for cancellation was explicitly reported.

So for example, instead of (GitHub Actions output):

⯈lint:mypy
⯈CI:test
task: Failed to run task "CI:lint": task: Failed to run task "lint:mypy": exit status 1
Error: Process completed with exit code 201.

have

⯈lint:mypy
⯈CI:test
task: Terminated `CI:test` because parallel running task `CI:lint` failed.
task: Failed to run task "CI:lint": task: Failed to run task "lint:mypy": exit status 1
Error: Process completed with exit code 201.

Activity

  1. self-assigned this
    on Dec 8, 2025
  2. removed their assignment
    on Feb 7, 2026
  3. trulede commented on Feb 8, 2026

    @trulede
    Contributor

    Deps are run with:

    errgroup.WithContext(ctx)
    g.Go(func() error {err := e.RunTask(......
    

    It might be possible to arrange something with

    context.AfterFunc(ctx, func() ....
    containing
    ctx.Err() // returns context.Canceled
    context.Cause(ctx) // returns myError
    
  4. trulede commented on Mar 19, 2026

    @trulede
    Contributor

    @aucampia A recent feature "failfast" has changed the behaviour here. When set false, parallel tasks will run to completion, even if a peer fails. You might like to try that.

    Solution note, save err for each task, check if errors.Is(err, contextCanceled) - in func (e *Executor) Run().

  5. added
    good first issueIssues that are good for first-time contributors to pick up.
    area: loopsChanges related to looping over tasks/commands.
    and removed
    state: needs triageWaiting to be triaged by a maintainer.
    on Mar 19, 2026
  6. added theissue type on Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: loopsChanges related to looping over tasks/commands.good first issueIssues that are good for first-time contributors to pick up.state: awaiting responseWaiting for issue author to respond.

    Fields

    No fields configured for feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions