Skip to content

[vs18.6] Fix telemetry allocation regression: per-engine collector ownership#13581

Merged
rainersigwald merged 5 commits intovs18.6from
backport/pr-13516-to-vs18.6
Apr 21, 2026
Merged

[vs18.6] Fix telemetry allocation regression: per-engine collector ownership#13581
rainersigwald merged 5 commits intovs18.6from
backport/pr-13516-to-vs18.6

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Apr 20, 2026

Description

https://dev.azure.com/devdiv/DevDiv/_workitems/edit/2855299/
A prior thread safety fix to telemetry infrastructure caused excessive copies of data. This pull request makes the telemetry objects owned correctly reducing the need to copy the data.

Customer Impact

caught by automated VS perf tests to cause 100s of MB extra allocations

Regression? (was it working in a previous release or preview?)

Yes

Risk (see taxonomy)

Low

Link the PR to the original issue and to the PR to main.

Backport of #13516 to vs18.6

JanProvaznik and others added 4 commits April 20, 2026 17:09
Eliminates ~200MB allocation regression from PR #13413 by removing
per-request WorkerNodeTelemetryData dictionary allocations entirely.

Each BuildRequestEngine creates its own ITelemetryForwarder (via
TelemetryForwarderProvider.CreateForwarder) and passes it to builders
through NodeLoggingContext:

- TelemetryForwarder owns WorkerNodeTelemetryData (no locking needed -
  the engine's one-active-builder-at-a-time invariant guarantees
  single-threaded access, see #13531)
- RequestBuilder calls AddTarget/AddTask directly
- BuildRequestEngine calls FinalizeProcessing at CleanupForBuild
- TelemetryForwarderProvider is the factory, not a data-holding singleton

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pure rename - no behavioral changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JanProvaznik
Copy link
Copy Markdown
Member

@copilot set version to 18.6.3 in eng/Versions.props

Agent-Logs-Url: https://github.com/dotnet/msbuild/sessions/fe8e1058-045d-44a3-8723-44bcfaf1c294

Co-authored-by: JanProvaznik <25267098+JanProvaznik@users.noreply.github.com>
Copilot AI requested a review from a team as a code owner April 21, 2026 13:51
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

@copilot set version to 18.6.3 in eng/Versions.props

Done in commit 7ccdd8aVersionPrefix updated to 18.6.3 in eng/Versions.props.

@JanProvaznik
Copy link
Copy Markdown
Member

note: merge after #13515

@JanProvaznik JanProvaznik added the merge-carefully Merge one at a time, verifying this doesn't break anything down the chain. label Apr 21, 2026
@rainersigwald rainersigwald enabled auto-merge (squash) April 21, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-carefully Merge one at a time, verifying this doesn't break anything down the chain.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants