Skip to content

Releases

v0.11.2: Task.WhenAll Cancellation Check

Choose a tag to compare

@github-actions github-actions released this 14 Nov 09:51

First release of the Task.WhenAll Cancellation Check action on GitHub Marketplace.

It flags Task.WhenAll calls in C# that keep the other operations running after one fails, as annotations on the pull request and a table in the job summary. It works on any C# repository, with no package reference and no change to your projects.

- uses: actions/setup-dotnet@v6
  with:
    dotnet-version: 10.0.x
- uses: gokhanertogan/StructuredConcurrency@v0.11.2

Inputs: project, fail-on-findings (default false, report only), build-arguments, analyzer-version. Output: findings. See the README for details.

Changes in 0.11.2

  • The action's description now fits Marketplace's 125-character limit. No change to the NuGet packages or to what the action does.
  • A workflow runs the action from each released tag with its defaults on Windows, Linux and macOS.

Use @v0.11.2 or later: @v0.11.0 can't load the analyzers on a fresh runner (fixed in 0.11.1).

v0.11.1

Choose a tag to compare

@github-actions github-actions released this 14 Nov 09:31

Fixes

  • GitHub Action: the action failed with CS8034: Unable to load Analyzer assembly on a fresh runner, because it
    saved the downloaded analyzers under a file name with the version in it, and the compiler loads an analyzer by its
    file name. Use @v0.11.1; @v0.11.0 doesn't work. The action also builds without the shared compiler server now, so
    an earlier build in the same job can't hand it another version of the analyzers.

v0.11.0

Choose a tag to compare

@github-actions github-actions released this 14 Nov 09:06

New

  • Analyzers: SC0004 (Task.WhenAll that doesn't cancel the rest on failure) can check a project without the
    package, when a .globalconfig sets structured_concurrency.analyze_without_package = true. Its code fix isn't
    offered there. Projects that use the package see no change.
  • GitHub Action: this repository is now the Task.WhenAll Cancellation Check action
    (uses: gokhanertogan/StructuredConcurrency@v0.11.0). It builds any C# repository with the analyzers added from
    outside and reports SC0004, plus SC0001-SC0003 where TaskGroup is used, as pull request annotations, a job
    summary and a findings output.

Other

  • Releases are also published to GitHub Packages.

v0.10.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 22:17

Breaking changes

  • TaskGroup.AnyAsync is now TaskGroup.FirstSuccessAsync, with the same overloads and behavior. The old name looked
    too much like Task.WhenAny, which returns the first task to complete, even a failed one. There is no alias, so
    rename the calls.
  • RestartEvent.Restart is now RestartEvent.RestartNumber. There is no alias, so rename the uses.

New

  • Group timeouts: TaskGroupOptions.Timeout cancels the whole group when it runs too long and throws a
    TimeoutException; TaskGroupOptions.TimeProvider makes it testable with FakeTimeProvider.
  • Quorums: TaskGroup.QuorumAsync returns the first N successes and cancels the rest, for replica reads and
    majority votes.
  • Groups without a lambda: TaskGroup.Create with JoinAsync and await using, like Java's
    StructuredTaskScope. Leaving the block without joining cancels the children and waits for them. It works where a
    lambda doesn't, such as an async iterator.
  • Pipelines: SelectConcurrentAsync takes an onFailure callback that skips and reports a failed item instead of
    ending the stream, and BufferAsync lets a stage read ahead of the one after it.
  • Why a child was cancelled: group.CancellationReason (Failure, Timeout, Requested, CallerToken,
    Disposed), like Go's context.Cause. It is set before the token is cancelled, so a child can read it in its
    catch.
  • Load shedding: group.TryRun(work, out task) starts a child only if a concurrency slot and a rate-limiter
    permit are free right now, like Go's errgroup.TryGo; otherwise it returns false and queues nothing.
  • Docs: per-item timeouts in a pipeline (Elixir's Task.async_stream timeout:) and cleanup that must run after
    cancellation (Kotlin's NonCancellable, Trio's shield), both built from WithTimeoutAsync.
  • Analyzers: SC0002 now also checks the body of TaskGroup.RunAsync and flags an outer token used where
    group.CancellationToken belongs, with a code fix. A new suppressor (SCSP0001) silences CS4014 on
    group.Run(...), whose task the group already awaits.

Fixes

  • SingleFlight: when every caller of a flight gave up, a new caller for the same key could start a second operation
    while the cancelled one was still running. The new caller now waits for the old operation to stop first.
  • default(TaskOutcome<T>).ToString() no longer throws.
  • Tracing: taskgroup.cancelled_by is now documented with all its values, including timeout and disposed.

Other

  • Samples: an ASP.NET Core minimal API (samples/WebApi) and a queue worker (samples/Worker).
  • The public API is tracked with PublicApiAnalyzers; stress tests and Stryker.NET mutation testing were added.
  • CONTRIBUTING.md, SECURITY.md, and issue and pull request templates.

v0.9.0

Choose a tag to compare

@github-actions github-actions released this 30 Oct 20:49

Full Changelog: v0.8.0...v0.9.0

v0.8.0

Choose a tag to compare

@github-actions github-actions released this 23 Oct 20:23

Full Changelog: v0.7.0...v0.8.0

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 23:18

Full Changelog: v0.6.0...v0.7.0

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 22:43

Full Changelog: v0.5.0...v0.6.0

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 22:24

Full Changelog: v0.4.0...v0.5.0

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 21:37

Full Changelog: v0.3.0...v0.4.0