Skip to content

Commit

Permalink
Trace WebSocket exception into verbose level to reduce noise in diag …
Browse files Browse the repository at this point in the history
…log. (actions#2591)
  • Loading branch information
TingluoHuang authored May 8, 2023
1 parent 22d1938 commit 1bc14f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Runner.Common/JobServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
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
{
Expand Down Expand Up @@ -254,7 +254,7 @@ public async Task AppendTimelineRecordFeedAsync(Guid scopeIdentifier, string hub
{
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
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/ResultsServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public async Task<bool> AppendLiveConsoleFeedAsync(Guid scopeIdentifier, string
{
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);
}
Expand Down

0 comments on commit 1bc14f0

Please sign in to comment.