Skip to content

Commit

Permalink
Fix logging of node reuse (#8509)
Browse files Browse the repository at this point in the history
Fixes issue causing failing insertion https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/454231

Context
Setting verbose logging and rebuilding twice was leading to build errors.
This was caused by the fact that low-pri node reuse log event didn't have BuildContext set and ParallelConsoleLogger was choking on it (null ref).

Fix
Setting BuildEventContext on the node reuse log event
  • Loading branch information
JanKrivanek authored Mar 2, 2023
1 parent a8416ab commit ed8d50f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ bool TryReuseAnyFromPossibleRunningNodes(int nodeId)
// Connection successful, use this node.
CommunicationsUtilities.Trace("Successfully connected to existed node {0} which is PID {1}", nodeId, nodeToReuse.Id);
string msg = ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("NodeReused", nodeId, nodeToReuse.Id);
_componentHost.LoggingService.LogBuildEvent(new BuildMessageEventArgs(msg, null, null, MessageImportance.Low));
_componentHost.LoggingService.LogBuildEvent(new BuildMessageEventArgs(msg, null, null, MessageImportance.Low)
{
BuildEventContext = new BuildEventContext(nodeId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId)
});

CreateNodeContext(nodeId, nodeToReuse, nodeStream);
return true;
Expand Down

0 comments on commit ed8d50f

Please sign in to comment.