Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions src/Runner.Common/BrokerServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using GitHub.DistributedTask.WebApi;
using GitHub.Runner.Sdk;
using GitHub.Services.Common;
using GitHub.Services.OAuth;
using GitHub.Services.WebApi;
using Sdk.RSWebApi.Contracts;
using Sdk.WebApi.WebApi.RawClient;
Expand Down Expand Up @@ -113,6 +114,14 @@ public bool ShouldRetryException(Exception ex)
return false;
}

// "invalid_client" means the runner registration has been deleted from the server.
// Retrying will never succeed, so bail out immediately.
if (ex is VssOAuthTokenRequestException oAuthEx &&
string.Equals(oAuthEx.Error, "invalid_client", StringComparison.OrdinalIgnoreCase))
{
return false;
}

return true;
}
}
Expand Down
13 changes: 10 additions & 3 deletions src/Runner.Listener/BrokerMessageListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,18 @@ ex is RunnerNotFoundException ||
Trace.Info($"Non-retriable exception: {ex.Message}");
return false;
}
else

// "invalid_client" means the runner registration has been deleted from the server.
// This is permanent — retrying will never succeed.
if (ex is VssOAuthTokenRequestException oAuthEx &&
string.Equals(oAuthEx.Error, "invalid_client", StringComparison.OrdinalIgnoreCase))
{
Trace.Info($"Retriable exception: {ex.Message}");
return true;
Trace.Info($"Non-retriable exception: runner registration deleted. {ex.Message}");
return false;
}

Trace.Info($"Retriable exception: {ex.Message}");
return true;
}

private bool IsSessionCreationExceptionRetriable(Exception ex)
Expand Down
Loading