Add ETW events for node launch lifecycle#13459
Merged
rainersigwald merged 3 commits intodotnet:mainfrom Mar 30, 2026
Merged
Conversation
Add NodeConnectStart/NodeConnectStop event pair to MSBuildEventSource (events 99-100) and instrument NodeProviderOutOfProcBase.GetNodes to emit them. The stop event reports the node ID, process ID, and whether the node was reused or newly launched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add NodeReuseScan, NodeLaunch, and NodePipeConnect start/stop event pairs (events 101-106) to break down the NodeConnect span into process enumeration, process creation, and pipe connect+handshake phases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds ETW instrumentation to the out-of-proc node acquisition path (GetNodes) to make it easier to diagnose timing/regressions around node reuse vs. launch (notably related to #13175’s apphost work).
Changes:
- Added new
MSBuildEventSourceETW events (IDs 99–106) for node connect, reuse scan, launch, and pipe connect lifecycle. - Emitted these events from
NodeProviderOutOfProcBase.GetNodesacross reuse + new-node creation flows.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Framework/MSBuildEventSource.cs | Introduces new ETW event definitions for node connect/reuse/launch/pipe connect lifecycle. |
| src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs | Emits the new ETW events in the create-or-connect node acquisition path. |
src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs
Show resolved
Hide resolved
src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs
Show resolved
Hide resolved
YuliiaKovalova
approved these changes
Mar 30, 2026
JanProvaznik
approved these changes
Mar 30, 2026
This was referenced Mar 30, 2026
JanProvaznik
added a commit
to JanProvaznik/msbuild
that referenced
this pull request
Mar 31, 2026
Renumber TaskHost callback events from 99-103 to 107-111 to avoid clashing with node launch lifecycle events added in dotnet#13459. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dfederm
pushed a commit
to dfederm/msbuild
that referenced
this pull request
Apr 9, 2026
Adds ETW instrumentation around the node create-or-connect path in `NodeProviderOutOfProcBase.GetNodes`, to help chase down a possible regression from dotnet#13175. ## New ETW events | Event | ID | Parameters | Description | |---|---|---|---| | `NodeConnectStart` | 99 | `nodeId` | Begin acquiring a node (reuse or launch) | | `NodeConnectStop` | 100 | `nodeId`, `processId`, `isReused` | Node acquired successfully | | `NodeReuseScanStart` | 101 | | Begin scanning for reusable node processes | | `NodeReuseScanStop` | 102 | `candidateCount` | Scan complete | | `NodeLaunchStart` | 103 | `nodeId` | Begin OS process creation | | `NodeLaunchStop` | 104 | `nodeId`, `processId` | Process created | | `NodePipeConnectStart` | 105 | `nodeId`, `processId` | Begin named pipe connect + handshake | | `NodePipeConnectStop` | 106 | `nodeId`, `processId`, `success` | Pipe connect complete | ## Timeline (new node) ``` NodeReuseScanStart / NodeReuseScanStop(candidates) NodeConnectStart(nodeId) NodeLaunchStart(nodeId) NodeLaunchStop(nodeId, pid) NodePipeConnectStart(nodeId, pid) NodePipeConnectStop(nodeId, pid, success) NodeConnectStop(nodeId, pid, isReused=false) ``` ## Timeline (reused node) ``` NodeReuseScanStart / NodeReuseScanStop(candidates) NodeConnectStart(nodeId) NodePipeConnectStart(nodeId, candidatePid) NodePipeConnectStop(nodeId, candidatePid, success) NodeConnectStop(nodeId, pid, isReused=true) ``` Both `NodeProviderOutOfProc` and `NodeProviderOutOfProcTaskHost` flow through `GetNodes`. No behavioral change. Pure observability addition. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds ETW instrumentation around the node create-or-connect path in
NodeProviderOutOfProcBase.GetNodes, to help chase down a possible regression from #13175.New ETW events
NodeConnectStartnodeIdNodeConnectStopnodeId,processId,isReusedNodeReuseScanStartNodeReuseScanStopcandidateCountNodeLaunchStartnodeIdNodeLaunchStopnodeId,processIdNodePipeConnectStartnodeId,processIdNodePipeConnectStopnodeId,processId,successTimeline (new node)
Timeline (reused node)
Both
NodeProviderOutOfProcandNodeProviderOutOfProcTaskHostflow throughGetNodes, so all node types are covered.No behavioral change. Pure observability addition.