diff --git a/src/Runner.Worker/ActionManager.cs b/src/Runner.Worker/ActionManager.cs index bf7838c1b5a..0dd891c1765 100644 --- a/src/Runner.Worker/ActionManager.cs +++ b/src/Runner.Worker/ActionManager.cs @@ -703,11 +703,12 @@ private async Task BuildActionContainerAsync(IExecutionContext executionContext, catch (Exception ex) when (!executionContext.CancellationToken.IsCancellationRequested) // Do not retry if the run is cancelled. { // UnresolvableActionDownloadInfoException is a 422 client error, don't retry + // NonRetryableActionDownloadInfoException is an non-retryable exception from Actions // Some possible cases are: // * Repo is rate limited // * Repo or tag doesn't exist, or isn't public // * Policy validation failed - if (attempt < 3 && !(ex is WebApi.UnresolvableActionDownloadInfoException)) + if (attempt < 3 && !(ex is WebApi.UnresolvableActionDownloadInfoException) && !(ex is WebApi.NonRetryableActionDownloadInfoException)) { executionContext.Output($"Failed to resolve action download info. Error: {ex.Message}"); executionContext.Debug(ex.ToString()); diff --git a/src/Sdk/DTWebApi/WebApi/Exceptions.cs b/src/Sdk/DTWebApi/WebApi/Exceptions.cs index 97505bb6a41..536bf755055 100644 --- a/src/Sdk/DTWebApi/WebApi/Exceptions.cs +++ b/src/Sdk/DTWebApi/WebApi/Exceptions.cs @@ -2498,6 +2498,25 @@ protected UnresolvableActionDownloadInfoException(SerializationInfo info, Stream } } + [Serializable] + public class NonRetryableActionDownloadInfoException : DistributedTaskException + { + public NonRetryableActionDownloadInfoException(String message) + : base(message) + { + } + + public NonRetryableActionDownloadInfoException(String message, Exception innerException) + : base(message, innerException) + { + } + + protected NonRetryableActionDownloadInfoException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } + [Serializable] public sealed class FailedToResolveActionDownloadInfoException : DistributedTaskException {