From bd0ed0e31956dc08e3d3e86c3f90a1b8a9bade42 Mon Sep 17 00:00:00 2001 From: Boris Krylov Date: Wed, 18 Feb 2026 09:00:35 +0400 Subject: [PATCH] handle cancelation in retry --- src/Runner.Common/RunnerService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Runner.Common/RunnerService.cs b/src/Runner.Common/RunnerService.cs index ccaa83f698f..5d7ffb136e0 100644 --- a/src/Runner.Common/RunnerService.cs +++ b/src/Runner.Common/RunnerService.cs @@ -98,7 +98,7 @@ protected async Task RetryRequest(Func> func, return await func(); } // TODO: Add handling of non-retriable exceptions: https://github.com/github/actions-broker/issues/122 - catch (Exception ex) when (attempt < maxAttempts && (shouldRetry == null || shouldRetry(ex))) + catch (Exception ex) when (!cancellationToken.IsCancellationRequested && attempt < maxAttempts && (shouldRetry == null || shouldRetry(ex))) { Trace.Error("Catch exception during request"); Trace.Error(ex);