161 references to CommunicationsUtilities
Microsoft.Build (158)
BackEnd\BuildManager\BuildParameters.cs (5)
654
internal static int ThreadStackSize =>
CommunicationsUtilities
.GetIntegerVariableOrDefault(
660
internal static int EndpointShutdownTimeout =>
CommunicationsUtilities
.GetIntegerVariableOrDefault(
666
internal static int EngineShutdownTimeout =>
CommunicationsUtilities
.GetIntegerVariableOrDefault(
678
internal static int LoggingThreadShutdownTimeout =>
CommunicationsUtilities
.GetIntegerVariableOrDefault(
684
internal static int RequestBuilderShutdownTimeout =>
CommunicationsUtilities
.GetIntegerVariableOrDefault(
BackEnd\Client\MSBuildClient.cs (29)
157
CommunicationsUtilities
.Trace("Executing build with command line '{0}'", descriptiveCommandLine);
168
CommunicationsUtilities
.Trace("Server was not running. Starting server now.");
180
CommunicationsUtilities
.Trace("Server is busy, falling back to former behavior.");
195
CommunicationsUtilities
.Trace("Failed to obtain the current build server state: {0}", ex);
196
CommunicationsUtilities
.Trace("HResult: {0}.", ex.HResult);
214
CommunicationsUtilities
.Trace("Build finished.");
240
CommunicationsUtilities
.Trace("Trying shutdown server node.");
245
CommunicationsUtilities
.Trace("No need to shutdown server node for it is not running.");
254
CommunicationsUtilities
.Trace("Server cannot be shut down for it is not idle.");
261
CommunicationsUtilities
.Trace("Client cannot connect to idle server to shut it down.");
267
CommunicationsUtilities
.Trace("Failed to send shutdown command to the server.");
282
CommunicationsUtilities
.Trace("Wait for server to be not busy - will retry soon...");
354
CommunicationsUtilities
.Trace("MSBuild client error: problem during packet handling occurred: {0}.", ex);
379
CommunicationsUtilities
.Trace("MSBuild client warning: problem during querying console buffer width.", ex);
412
CommunicationsUtilities
.Trace("Command packet of type '{0}' sent...", packet.Type);
416
CommunicationsUtilities
.Trace("Failed to send command packet of type '{0}' to server: {1}", packet?.Type.ToString() ?? "Unknown", ex);
440
CommunicationsUtilities
.Trace("Another process launching the msbuild server, falling back to former behavior.");
447
CommunicationsUtilities
.Trace("Failed to obtain the current build server state: {0}", ex);
448
CommunicationsUtilities
.Trace("HResult: {0}.", ex.HResult);
461
CommunicationsUtilities
.Trace("Starting Server...");
463
CommunicationsUtilities
.Trace("Server started with PID: {0}", msbuildProcess?.Id);
467
CommunicationsUtilities
.Trace("Failed to launch the msbuild server: {0}", ex);
481
CommunicationsUtilities
.Trace("Sending shutdown command to server.");
522
private ServerNodeHandshake GetHandshake() => new(
CommunicationsUtilities
.GetHandshakeOptions(
534
CommunicationsUtilities
.Trace("MSBuild client sent cancellation command.");
544
CommunicationsUtilities
.Trace("MSBuild client error: packet pump unexpectedly shut down: {0}", packetPump.PacketPumpException);
589
CommunicationsUtilities
.Trace("Build response received: exit code '{0}', exit type '{1}'", response.ExitCode, response.ExitType);
618
CommunicationsUtilities
.Trace("Retrying to connect to server after {0} ms", sw.ElapsedMilliseconds);
626
CommunicationsUtilities
.Trace("Failed to connect to server: {0}", result.ErrorMessage);
BackEnd\Client\MSBuildClientPacketPump.cs (5)
202
CommunicationsUtilities
.Trace("Entering read loop.");
235
CommunicationsUtilities
.Trace("Shutdown message pump thread.");
301
CommunicationsUtilities
.Trace("Packet factory failed to receive package. Exception while deserializing packet {0}.", packetType);
332
CommunicationsUtilities
.Trace("Exception occurred in the packet pump: {0}", ex);
336
CommunicationsUtilities
.Trace("Ending read loop.");
BackEnd\Components\Communications\NodeEndpointOutOfProc.cs (1)
37
HandshakeOptions handshakeOptions =
CommunicationsUtilities
.GetHandshakeOptions(
BackEnd\Components\Communications\NodeLauncher.cs (5)
63
CommunicationsUtilities
.Trace("Launching node from {0}", nodeLaunchData.MSBuildLocation);
144
CommunicationsUtilities
.Trace("Successfully launched {1} node with PID {0}", process.Id, exeName);
149
CommunicationsUtilities
.Trace(
205
CommunicationsUtilities
.Trace(
217
CommunicationsUtilities
.Trace("Successfully launched {1} node with PID {0}", processInfo.dwProcessId, exeName);
BackEnd\Components\Communications\NodeProviderInProc.cs (1)
395
int connectionTimeout =
CommunicationsUtilities
.NodeConnectionTimeout;
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (4)
72
CommunicationsUtilities
.Trace("MSBUILDNODEHANDSHAKESALT=\"{0}\", msbuildDirectory=\"{1}\", enableNodeReuse={2}, enableLowPriority={3}", Traits.MSBuildNodeHandshakeSalt, BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32, enableNodeReuse, enableLowPriority);
73
return new Handshake(
CommunicationsUtilities
.GetHandshakeOptions(taskHost: false, taskHostParameters: TaskHostParameters.Empty, architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture(), nodeReuse: enableNodeReuse, lowPriority: enableLowPriority));
92
Handshake hostHandshake = new(
CommunicationsUtilities
.GetHandshakeOptions(taskHost: false, taskHostParameters: TaskHostParameters.Empty, architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture(), nodeReuse: ComponentHost.BuildParameters.EnableNodeReuse, lowPriority: ComponentHost.BuildParameters.LowPriority));
104
CommunicationsUtilities
.Trace("Starting to acquire {1} new or existing node(s) to establish nodes from ID {0} to {2}...", nextNodeId, numberOfNodesToCreate, nextNodeId + numberOfNodesToCreate - 1);
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (38)
192
CommunicationsUtilities
.Trace("Shutting down node with pid = {0}", nodeProcess.Id);
289
CommunicationsUtilities
.Trace("Attempting to connect to {1} existing processes '{0}'...", expectedProcessName, possibleRunningNodesList.Count);
310
CommunicationsUtilities
.Trace("FAILED TO CONNECT TO A CHILD NODE");
332
CommunicationsUtilities
.Trace("Trying to connect to existing process {2} with id {1} to establish node {0}...", nodeId, nodeToReuse.Id, nodeToReuse.ProcessName);
355
CommunicationsUtilities
.Trace("Successfully connected to existed node {0} which is PID {1}", nodeId, nodeToReuse.Id);
374
CommunicationsUtilities
.Trace("Could not connect to existing process, now creating a process...");
422
CommunicationsUtilities
.Trace("Successfully connected to created node {0} which is PID {1}", nodeId, msbuildProcess.Id);
435
CommunicationsUtilities
.Trace("Could not connect to node with PID {0}; it has exited with exit code {1}. This can indicate a crash at startup", msbuildProcess.Id, msbuildProcess.ExitCode);
441
CommunicationsUtilities
.Trace("Could not connect to node with PID {0}; it has exited with unknown exit code. This can indicate a crash at startup", msbuildProcess.Id);
447
CommunicationsUtilities
.Trace("Could not connect to node with PID {0}; it is still running. This can occur when two multiprocess builds run in parallel and the other one 'stole' this node", msbuildProcess.Id);
513
CommunicationsUtilities
.Trace("Filtering {0} candidate processes by NodeMode {1} for process name '{2}'", processes.Length, expectedNodeMode, expectedProcessName);
523
CommunicationsUtilities
.Trace("Skipping process {0} - unable to retrieve command line", process.Id);
531
CommunicationsUtilities
.Trace("Including process {0} - command line retrieval not supported on this platform", process.Id);
539
CommunicationsUtilities
.Trace("Including process {0} with matching NodeMode {1}", process.Id, processNodeMode.Value);
544
CommunicationsUtilities
.Trace(
553
CommunicationsUtilities
.Trace("Skipping process {0} - error retrieving command line: {1}", process.Id, ex.Message);
559
CommunicationsUtilities
.Trace("Filtered to {0} processes matching NodeMode {1}", filtered.Count, expectedNodeMode);
597
CommunicationsUtilities
.Trace("Node reuse threshold is 0, terminating all {0} nodes", nodeCount);
604
CommunicationsUtilities
.Trace("System-wide node count: {0}, threshold: {1}, this instance has: {2} nodes",
622
CommunicationsUtilities
.Trace("Keeping {0} of {1} nodes in this instance to help meet threshold of {2}",
673
CommunicationsUtilities
.Trace("Error counting system-wide nodes with mode {0}: {1}", nodeMode, ex.Message);
771
CommunicationsUtilities
.Trace("Attempting connect to PID {0} with pipe {1} with timeout {2} ms", nodeProcessId, pipeName, timeout);
781
CommunicationsUtilities
.Trace("Failed to connect to pipe {0}. {1}", pipeName, result.ErrorMessage.TrimEnd());
793
CommunicationsUtilities
.Trace("Failed to connect to pipe {0}. {1}", pipeName, e.Message.TrimEnd());
830
CommunicationsUtilities
.Trace("Writing handshake part {0} ({1}) to pipe {2}", component.Key, component.Value, pipeName);
837
CommunicationsUtilities
.Trace("Reading handshake from pipe {0}", pipeName);
847
CommunicationsUtilities
.Trace("Successfully connected to pipe {0}...!", pipeName);
1040
CommunicationsUtilities
.Trace(_nodeId, "EXCEPTION in RunPacketReadLoopAsync: {0}", e);
1073
CommunicationsUtilities
.Trace(_nodeId, "EXCEPTION in RunPacketReadLoopAsync (Reading): {0}", e);
1188
CommunicationsUtilities
.Trace(context._nodeId, "EXCEPTION in SendData: {0}", e);
1243
CommunicationsUtilities
.Trace("Waiting for node with pid = {0} to exit", _process.Id);
1271
CommunicationsUtilities
.Trace("Killing node with pid = {0}", _process.Id);
1280
CommunicationsUtilities
.Trace(_nodeId, "COMMUNICATIONS ERROR (HRC) Node: {0} Process: {1} Bytes Read: {2} Expected: {3}", _nodeId, _process.Id, bytesRead, _headerByte.Length);
1285
CommunicationsUtilities
.Trace(_nodeId, " Child Process {0} has exited.", _process.Id);
1289
CommunicationsUtilities
.Trace(_nodeId, " Child Process {0} is still running.", _process.Id);
1294
CommunicationsUtilities
.Trace(_nodeId, "Unable to retrieve remote process information. {0}", e);
1356
CommunicationsUtilities
.Trace(_nodeId, "Bad packet read for packet {0} - Expected {1} bytes, got {2}", packetType, packetLength, bytesRead);
1373
CommunicationsUtilities
.Trace(_nodeId, "EXCEPTION in ReadAndRoutPacket: {0}", e);
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (4)
659
CommunicationsUtilities
.Trace("DisconnectFromHost: Node context already removed for key: {0}", nodeKey);
705
CommunicationsUtilities
.Trace("For a host context of {0}, spawning executable from {1}.", hostContext, nodeLaunchData.MSBuildLocation);
789
CommunicationsUtilities
.Trace("For a host context of {0}, using app host from {1}.", hostContext, appHostPath);
811
CommunicationsUtilities
.Trace("For a host context of {0}, app host not found at {1}, falling back to dotnet.exe from {2}.", hostContext, appHostPath, resolvedDotnetHostPath);
BackEnd\Components\Communications\RarNodeLauncher.cs (3)
34
CommunicationsUtilities
.Trace("Existing RAR node found.");
38
CommunicationsUtilities
.Trace("Launching RAR node...");
46
CommunicationsUtilities
.Trace("Failed to launch RAR node: {0}", ex);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
913
entryToComplete.RequestConfiguration.SavedEnvironmentVariables = entryToComplete.TaskEnvironment.GetEnvironmentVariables().ToFrozenDictionary(
CommunicationsUtilities
.EnvironmentVariableComparer);
1401
_requestEntry.RequestConfiguration.SavedEnvironmentVariables = _requestEntry.TaskEnvironment.GetEnvironmentVariables().ToFrozenDictionary(
CommunicationsUtilities
.EnvironmentVariableComparer);
BackEnd\Node\OutOfProcNode.cs (3)
459
CommunicationsUtilities
.Trace("Shutting down with reason: {0}, and exception: {1}.", _shutdownReason, _shutdownException);
507
CommunicationsUtilities
.Trace("Failed to restore the original environment: {0}.", ex);
544
CommunicationsUtilities
.Trace("Shut down complete.");
BackEnd\Node\OutOfProcServerNode.cs (7)
97
CommunicationsUtilities
.GetHandshakeOptions(taskHost: false, taskHostParameters: TaskHostParameters.Empty, architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture()));
103
CommunicationsUtilities
.Trace("Starting new server node with handshake {0}", handshake);
251
CommunicationsUtilities
.Trace("Shutting down with reason: {0}, and exception: {1}.", _shutdownReason, _shutdownException);
262
CommunicationsUtilities
.Trace("Shut down complete.");
332
CommunicationsUtilities
.Trace("Terminating server node due to over-provisioning: {0} server nodes found system-wide.", serverNodeCount);
343
CommunicationsUtilities
.Trace("Received request to cancel build running on MSBuild Server. MSBuild server will shutdown.");
367
CommunicationsUtilities
.Trace("Building with MSBuild server with command line {0}", command.CommandLine);
BackEnd\Shared\BuildRequestConfiguration.cs (1)
961
translator.TranslateDictionary(ref _savedEnvironmentVariables,
CommunicationsUtilities
.EnvironmentVariableComparer);
BackEnd\Shared\BuildResult.cs (4)
672
translator.TranslateDictionary(ref _savedEnvironmentVariables,
CommunicationsUtilities
.EnvironmentVariableComparer);
685
translator.TranslateDictionary(ref savedEnvironmentVariables,
CommunicationsUtilities
.EnvironmentVariableComparer, ref additionalEntries, s_additionalEntriesKeys);
693
translator.TranslateDictionary(ref savedEnvironmentVariables,
CommunicationsUtilities
.EnvironmentVariableComparer, ref additionalEntries, s_additionalEntriesKeys);
695
.ToFrozenDictionary(
CommunicationsUtilities
.EnvironmentVariableComparer); // no-op if already frozen
CommunicationsUtilities.cs (19)
273
const int handshakeVersion = (int)
CommunicationsUtilities
.handshakeVersion;
275
CommunicationsUtilities
.Trace("Building handshake for node type {0}, (version {1}): options {2}.", nodeType, handshakeVersion, options);
280
int salt =
CommunicationsUtilities
.GetHashCode($"{handshakeSalt}{toolsDirectory}");
282
CommunicationsUtilities
.Trace("Handshake salt is {0}", handshakeSalt);
283
CommunicationsUtilities
.Trace("Tools directory root is {0}", toolsDirectory);
333
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.Options),
334
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.Salt),
335
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.FileVersionMajor),
336
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.FileVersionMinor),
337
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.FileVersionBuild),
338
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.FileVersionPrivate),
339
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.SessionId));
343
public virtual byte? ExpectedVersionInFirstByte =>
CommunicationsUtilities
.handshakeVersion;
361
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.Options),
362
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.Salt),
363
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.FileVersionMajor),
364
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.FileVersionMinor),
365
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.FileVersionBuild),
366
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(_handshakeComponents.FileVersionPrivate));
Evaluation\IntrinsicFunctions.cs (3)
435
=>
CommunicationsUtilities
.GetHashCode(toHash);
449
StringHashingAlgorithm.Legacy =>
CommunicationsUtilities
.GetHashCode(toHash),
507
HandshakeOptions desiredContext =
CommunicationsUtilities
.GetHandshakeOptions(taskHost: true, taskHostParameters: parameters);
Instance\TaskFactories\TaskHostTask.cs (1)
360
_requiredContext =
CommunicationsUtilities
.GetHandshakeOptions(
NodeEndpointOutOfProcBase.cs (23)
293
CommunicationsUtilities
.Trace("Changing link status from {0} to {1}", _status.ToString(), newStatus.ToString());
380
int waitTimeRemaining = Math.Max(0,
CommunicationsUtilities
.NodeConnectionTimeout - (int)usedWaitTime.TotalMilliseconds);
391
CommunicationsUtilities
.Trace("Waiting for connection {0} ms...", waitTimeRemaining);
396
CommunicationsUtilities
.Trace("Connection timed out waiting a host to contact us. Exiting comm thread.");
401
CommunicationsUtilities
.Trace("Parent started connecting. Reading handshake from parent");
419
byteToAccept: index == 0 ? (byte?)
CommunicationsUtilities
.handshakeVersion : null, /* this will disconnect a < 16.8 host; it expects leading 00 or F5 or 06. 0x00 is a wildcard */
425
CommunicationsUtilities
.Trace($"Handshake failed with error: {result.ErrorMessage}");
430
CommunicationsUtilities
.Trace(
460
CommunicationsUtilities
.Trace("Sent PacketVersion: {0}", NodePacketTypeExtensions.PacketVersion);
463
CommunicationsUtilities
.Trace("Successfully connected to parent.");
490
CommunicationsUtilities
.Trace("Client connection failed but we will wait for another connection. Exception: {0}", e.Message);
512
CommunicationsUtilities
.Trace("Client connection failed. Exiting comm thread. {0}", e);
529
CommunicationsUtilities
.Trace("Ending read loop");
578
CommunicationsUtilities
.Trace("Handshake for NET Host. Child host {0} for {1}.", handshakePart, component.Key);
582
CommunicationsUtilities
.Trace(
622
CommunicationsUtilities
.Trace("Entering read loop.");
666
CommunicationsUtilities
.Trace("Exception reading from server. {0}", e);
680
CommunicationsUtilities
.Trace("Parent disconnected gracefully.");
687
CommunicationsUtilities
.Trace("Parent disconnected abruptly.");
693
CommunicationsUtilities
.Trace("Incomplete header read from server. {0} of {1} bytes read", bytesRead, headerByte.Length);
725
CommunicationsUtilities
.Trace("Exception while deserializing packet {0}: {1}", packetType, e);
784
CommunicationsUtilities
.Trace("Exception while serializing packets: {0}", e);
793
CommunicationsUtilities
.Trace("Disconnecting voluntarily");
Microsoft.Build.Engine.UnitTests (3)
BackEnd\AppHostSupport_Tests.cs (2)
193
HandshakeOptions options =
CommunicationsUtilities
.GetHandshakeOptions(
239
HandshakeOptions options =
CommunicationsUtilities
.GetHandshakeOptions(
CommunicationUtilities_Tests.cs (1)
10
using CommunicationsUtilities = Microsoft.Build.Internal.
CommunicationsUtilities
;