Backoff to avoid excessive retries to Run Service in a duration (#3354)

This commit is contained in:
eric sciple
2024-06-24 16:33:22 -05:00
committed by GitHub
parent ecb732eaf4
commit 054fc2e046
6 changed files with 318 additions and 6 deletions

View File

@@ -62,7 +62,10 @@ namespace GitHub.Runner.Common
CheckConnection();
return RetryRequest<AgentJobRequestMessage>(
async () => await _runServiceHttpClient.GetJobMessageAsync(requestUri, id, VarUtil.OS, cancellationToken), cancellationToken,
shouldRetry: ex => ex is not TaskOrchestrationJobAlreadyAcquiredException);
shouldRetry: ex =>
ex is not TaskOrchestrationJobNotFoundException && // HTTP status 404
ex is not TaskOrchestrationJobAlreadyAcquiredException && // HTTP status 409
ex is not TaskOrchestrationJobUnprocessableException); // HTTP status 422
}
public Task CompleteJobAsync(