From 2a6f271afaa3f3103962e2b987d58bce2a0b831f Mon Sep 17 00:00:00 2001 From: Tingluo Huang Date: Thu, 28 Sep 2023 09:35:55 -0400 Subject: [PATCH] Throw TimeoutException instead of OperationCanceledException on the final retry in DownloadRepositoryAction. (#2895) --- src/Runner.Worker/ActionManager.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Runner.Worker/ActionManager.cs b/src/Runner.Worker/ActionManager.cs index f5575684b..56196c6e4 100644 --- a/src/Runner.Worker/ActionManager.cs +++ b/src/Runner.Worker/ActionManager.cs @@ -854,6 +854,11 @@ namespace GitHub.Runner.Worker Trace.Info("Action download has been cancelled."); throw; } + catch (OperationCanceledException ex) when (!executionContext.CancellationToken.IsCancellationRequested && retryCount >= 2) + { + Trace.Info($"Action download final retry timeout after {timeoutSeconds} seconds."); + throw new TimeoutException($"Action '{link}' download has timed out. Error: {ex.Message}"); + } catch (ActionNotFoundException) { Trace.Info($"The action at '{link}' does not exist");