From 1bc14f0607b53d50ac4fabe0d9965818e516d0d5 Mon Sep 17 00:00:00 2001 From: Tingluo Huang Date: Mon, 8 May 2023 18:54:34 -0400 Subject: [PATCH] Trace WebSocket exception into verbose level to reduce noise in diag log. (#2591) --- src/Runner.Common/JobServer.cs | 6 +++--- src/Runner.Common/ResultsServer.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Runner.Common/JobServer.cs b/src/Runner.Common/JobServer.cs index c0719f615..a66260999 100644 --- a/src/Runner.Common/JobServer.cs +++ b/src/Runner.Common/JobServer.cs @@ -11,10 +11,10 @@ using System.Threading.Tasks; using GitHub.DistributedTask.WebApi; using GitHub.Runner.Sdk; using GitHub.Services.Common; +using GitHub.Services.OAuth; +using GitHub.Services.Results.Client; using GitHub.Services.WebApi; using GitHub.Services.WebApi.Utilities.Internal; -using GitHub.Services.Results.Client; -using GitHub.Services.OAuth; namespace GitHub.Runner.Common { @@ -254,7 +254,7 @@ namespace GitHub.Runner.Common { failedAttemptsToPostBatchedLinesByWebsocket++; Trace.Info($"Caught exception during append web console line to websocket, let's fallback to sending via non-websocket call (total calls: {totalBatchedLinesAttemptedByWebsocket}, failed calls: {failedAttemptsToPostBatchedLinesByWebsocket}, websocket state: {this._websocketClient?.State})."); - Trace.Error(ex); + Trace.Verbose(ex.ToString()); if (totalBatchedLinesAttemptedByWebsocket > _minWebsocketBatchedLinesCountToConsider) { // let's consider failure percentage diff --git a/src/Runner.Common/ResultsServer.cs b/src/Runner.Common/ResultsServer.cs index 905d71708..9ba49349d 100644 --- a/src/Runner.Common/ResultsServer.cs +++ b/src/Runner.Common/ResultsServer.cs @@ -222,7 +222,7 @@ namespace GitHub.Runner.Common { var delay = BackoffTimerHelper.GetRandomBackoff(MinDelayForWebsocketReconnect, MaxDelayForWebsocketReconnect); Trace.Info($"Websocket is not open, let's attempt to connect back again with random backoff {delay} ms."); - Trace.Error(ex); + Trace.Verbose(ex.ToString()); retries++; InitializeWebsocketClient(_liveConsoleFeedUrl, _token, delay); }