Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1772,7 +1772,7 @@ public static IBuildComponent CreateLoggingService(LoggerMode mode, int nodeId,
/// Override the method to log which event was processed so it can be verified in a test
/// </summary>
/// <param name="buildEvent">Build event which was asked to be processed</param>
internal override void ProcessLoggingEvent(object buildEvent, bool allowThrottling = false)
internal override void ProcessLoggingEvent(object buildEvent)
{
if (buildEvent is BuildEventArgs)
{
Expand Down
13 changes: 4 additions & 9 deletions src/Build/BackEnd/Components/Logging/LoggingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ public void PacketReceived(int node, INodePacket packet)

LogMessagePacket loggingPacket = (LogMessagePacket)packet;
InjectNonSerializedData(loggingPacket);
ProcessLoggingEvent(loggingPacket.NodeBuildEvent, allowThrottling: true);
ProcessLoggingEvent(loggingPacket.NodeBuildEvent);
}

/// <summary>
Expand Down Expand Up @@ -1060,24 +1060,19 @@ public void LogBuildEvent(BuildEventArgs buildEvent)
/// This method will becalled from multiple threads in asynchronous mode.
///
/// Determine where to send the buildevent either to the filters or to a specific sink.
/// When in Asynchronous mode the event should to into the logging queue (as long as we are initialized).
/// When in Asynchronous mode the event should go into the logging queue (as long as we are initialized).
/// In Synchronous mode the event should be routed to the correct sink or logger right away
/// </summary>
/// <param name="buildEvent">BuildEventArgs to process</param>
/// <param name="allowThrottling"><code>true</code> to allow throttling, otherwise <code>false</code>.</param>
/// <exception cref="InternalErrorException">buildEvent is null</exception>
internal virtual void ProcessLoggingEvent(object buildEvent, bool allowThrottling = false)
internal virtual void ProcessLoggingEvent(object buildEvent)
{
ErrorUtilities.VerifyThrow(buildEvent != null, "buildEvent is null");
if (_logMode == LoggerMode.Asynchronous)
{
// If the queue is at capacity, this call will block - the task returned by SendAsync only completes
// when the message is actually consumed or rejected (permanently) by the buffer.
var task = _loggingQueue.SendAsync(buildEvent);
if (allowThrottling)
{
task.Wait();
}
_loggingQueue.SendAsync(buildEvent).Wait();
}
else
{
Expand Down