Skip to content

[release/11.0] Restore current task tracking for runtime async dispatch - #133015

Merged
steveisok merged 1 commit into
release/11.0from
backport/pr-132969-to-release/11.0
Sep 15, 2026
Merged

steveisok merged 1 commit into
release/11.0from
backport/pr-132969-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Backport of #132969 to release/11.0

/cc @max-charlamb

Customer Impact

  • Customer reported
  • Found internally

On the standard, non-instrumented runtime-async dispatch path, AsyncDispatcherInfo.CurrentTask is not populated. As a result, diagnostics tools analyzing a live process or crash dump cannot deterministically associate a runtime-async continuation chain with its parent Task, which can produce incomplete or incorrect async task relationships. The issue affects .NET 11 runtime-async diagnostics when instrumentation is not enabled.

Regression

  • Yes
  • No

This regression was introduced by #126091, when the instrumented and non-instrumented continuation-dispatch paths were separated. Before that change, the shared dispatch path populated CurrentTask. The instrumented path still sets it through RuntimeAsyncInstrumentationHelpers.ResumeRuntimeAsyncContext, but the standard path lost the assignment.

Testing

The corresponding fix on main built Release CoreCLR and libraries successfully and ran System.Runtime.Tests with 77,810 tests passing and 88 skipped. BenchmarkDotNet testing covered 10 million runtime-async suspension/resumption operations per invocation and found no performance regression across 10 paired runs.

No new test was added because this change restores diagnostic metadata held in stack-local dispatcher state rather than changing observable task execution behavior. The issue was missed when #126091 split the dispatch paths because existing tests validate runtime-async behavior and instrumentation, but do not inspect the non-instrumented stack state consumed by live-process and crash-dump diagnostics.

Risk

Low. The change adds one pointer assignment to a stack-local AsyncDispatcherInfo immediately before continuation dispatch. It restores the behavior that existed before #126091 and matches the current-task tracking already performed by the instrumented path. It does not change control flow, public APIs, task completion semantics, or persisted data. Performance measurements detected no regression; ReadyToRun code size for RuntimeAsyncTask<int>.DispatchContinuations increased by 7 bytes, from 1,488 to 1,495 bytes.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • For .NET 8 and .NET 9: The PR target branch is release/X.0-staging, not release/X.0.
  • For .NET 10+: The PR target branch is release/X.0 (no -staging suffix).

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@steveisok steveisok added the Servicing-approved Approved for servicing release label Sep 1, 2026
@steveisok
steveisok self-requested a review September 1, 2026 13:39
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

@akoeplinger

Copy link
Copy Markdown
Member

@steveisok @max-charlamb can you please fill out the servicing template?

@steveisok
steveisok merged commit 002c79e into release/11.0 Sep 15, 2026
114 checks passed
@steveisok
steveisok deleted the backport/pr-132969-to-release/11.0 branch September 15, 2026 19:27
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc2 milestone Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-VM-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants