handle conflict errors from run service (#2570)

* handle conflict errors from run service

* nit: formatting

* fix formatting
This commit is contained in:
Yashwanth Anantharaju
2023-04-27 13:59:12 -04:00
committed by GitHub
parent 58f3ff55aa
commit c8c47d4f27
5 changed files with 41 additions and 7 deletions

View File

@@ -549,7 +549,17 @@ namespace GitHub.Runner.Listener
{
var runServer = HostContext.CreateService<IRunServer>();
await runServer.ConnectAsync(new Uri(messageRef.RunServiceUrl), creds);
jobRequestMessage = await runServer.GetJobMessageAsync(messageRef.RunnerRequestId, messageQueueLoopTokenSource.Token);
try
{
jobRequestMessage =
await runServer.GetJobMessageAsync(messageRef.RunnerRequestId,
messageQueueLoopTokenSource.Token);
}
catch (TaskOrchestrationJobAlreadyAcquiredException)
{
Trace.Info("Job is already acquired, skip this message.");
continue;
}
}
jobDispatcher.Run(jobRequestMessage, runOnce);