Skip to content

Commit bbfe6a3

Browse files
committed
Fix incorrect node context creation - we correctly only ever log the cache-based projectstarted messages from the scheduler node. Before we were incorrectly saying they came from the remote node.
1 parent 60b91a4 commit bbfe6a3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/Build/BackEnd/Components/Logging/LoggingServiceLogMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ public ProjectStartedEventArgs CreateProjectStartedForCachedProject(
574574
string targetNames,
575575
string toolsVersion)
576576
{
577-
Debug.Assert(remoteNodeEvaluationBuildEventContext.NodeId == Scheduler.InProcNodeId, "Cached project build events should only be logged from the in-proc scheduler node.");
577+
Debug.Assert(currentNodeBuildEventContext.NodeId == Scheduler.VirtualNode, "Cached project build events should only be logged from the scheduler virtual node.");
578578

579579
BuildEventContext validatedRemoteNodeEvaluationBuildContext = ValidatePreexistingProjectContextId(
580580
remoteNodeEvaluationBuildEventContext,

src/Build/BackEnd/Components/Scheduler/Scheduler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,8 +2202,7 @@ private ScheduleResponse GetResponseForResult(int parentRequestNode, BuildReques
22022202
private void LogRequestHandledFromCache(BuildRequest request, BuildResult result)
22032203
{
22042204
BuildRequestConfiguration configuration = _configCache[request.ConfigurationId];
2205-
int nodeId = _schedulingData.GetAssignedNodeForRequestConfiguration(request.ConfigurationId);
2206-
NodeLoggingContext nodeContext = new NodeLoggingContext(_componentHost.LoggingService, s_schedulerNodeBuildEventContext, nodeId, true);
2205+
NodeLoggingContext nodeContext = new NodeLoggingContext(_componentHost.LoggingService, s_schedulerNodeBuildEventContext, VirtualNode, true);
22072206
nodeContext.LogRequestHandledFromCache(request, configuration, result);
22082207

22092208
TraceScheduler(

0 commit comments

Comments
 (0)