diff --git a/src/Runner.Common/Constants.cs b/src/Runner.Common/Constants.cs index 041b5be9a37..a9f91223a99 100644 --- a/src/Runner.Common/Constants.cs +++ b/src/Runner.Common/Constants.cs @@ -161,7 +161,6 @@ public static class Features { public static readonly string DiskSpaceWarning = "runner.diskspace.warning"; public static readonly string LogTemplateErrorsAsDebugMessages = "DistributedTask.LogTemplateErrorsAsDebugMessages"; - public static readonly string SkipRetryCompleteJobUponKnownErrors = "actions_skip_retry_complete_job_upon_known_errors"; public static readonly string UseContainerPathForTemplate = "DistributedTask.UseContainerPathForTemplate"; public static readonly string AllowRunnerContainerHooks = "DistributedTask.AllowRunnerContainerHooks"; } diff --git a/src/Runner.Common/RunServer.cs b/src/Runner.Common/RunServer.cs index 9c3b1bdfbf2..19b389a3207 100644 --- a/src/Runner.Common/RunServer.cs +++ b/src/Runner.Common/RunServer.cs @@ -32,18 +32,6 @@ Task CompleteJobAsync( string billingOwnerId, CancellationToken token); - Task CompleteJob2Async( - Guid planId, - Guid jobId, - TaskResult result, - Dictionary outputs, - IList stepResults, - IList jobAnnotations, - string environmentUrl, - IList telemetry, - string billingOwnerId, - CancellationToken token); - Task RenewJobAsync(Guid planId, Guid jobId, CancellationToken token); } @@ -82,7 +70,6 @@ ex is not TaskOrchestrationJobAlreadyAcquiredException && // HTTP status 409 ex is not TaskOrchestrationJobUnprocessableException); // HTTP status 422 } - // Legacy will be deleted when SkipRetryCompleteJobUponKnownErrors is cleaned up public Task CompleteJobAsync( Guid planId, Guid jobId, @@ -94,23 +81,6 @@ public Task CompleteJobAsync( IList telemetry, string billingOwnerId, CancellationToken cancellationToken) - { - CheckConnection(); - return RetryRequest( - async () => await _runServiceHttpClient.CompleteJobAsync(requestUri, planId, jobId, result, outputs, stepResults, jobAnnotations, environmentUrl, telemetry, billingOwnerId, cancellationToken), cancellationToken); - } - - public Task CompleteJob2Async( - Guid planId, - Guid jobId, - TaskResult result, - Dictionary outputs, - IList stepResults, - IList jobAnnotations, - string environmentUrl, - IList telemetry, - string billingOwnerId, - CancellationToken cancellationToken) { CheckConnection(); return RetryRequest( diff --git a/src/Runner.Worker/JobRunner.cs b/src/Runner.Worker/JobRunner.cs index 54710b86e32..32447470645 100644 --- a/src/Runner.Worker/JobRunner.cs +++ b/src/Runner.Worker/JobRunner.cs @@ -318,24 +318,17 @@ private async Task CompleteJobAsync(IRunServer runServer, IExecution { try { - if (jobContext.Global.Variables.GetBoolean(Constants.Runner.Features.SkipRetryCompleteJobUponKnownErrors) ?? false) - { - await runServer.CompleteJob2Async(message.Plan.PlanId, message.JobId, result, jobContext.JobOutputs, jobContext.Global.StepsResult, jobContext.Global.JobAnnotations, environmentUrl, telemetry, billingOwnerId: message.BillingOwnerId, default); - } - else - { - await runServer.CompleteJobAsync(message.Plan.PlanId, message.JobId, result, jobContext.JobOutputs, jobContext.Global.StepsResult, jobContext.Global.JobAnnotations, environmentUrl, telemetry, billingOwnerId: message.BillingOwnerId, default); - } + await runServer.CompleteJobAsync(message.Plan.PlanId, message.JobId, result, jobContext.JobOutputs, jobContext.Global.StepsResult, jobContext.Global.JobAnnotations, environmentUrl, telemetry, billingOwnerId: message.BillingOwnerId, default); return result; } - catch (VssUnauthorizedException ex) when (jobContext.Global.Variables.GetBoolean(Constants.Runner.Features.SkipRetryCompleteJobUponKnownErrors) ?? false) + catch (VssUnauthorizedException ex) { Trace.Error($"Catch exception while attempting to complete job {message.JobId}, job request {message.RequestId}."); Trace.Error(ex); exceptions.Add(ex); break; } - catch (TaskOrchestrationJobNotFoundException ex) when (jobContext.Global.Variables.GetBoolean(Constants.Runner.Features.SkipRetryCompleteJobUponKnownErrors) ?? false) + catch (TaskOrchestrationJobNotFoundException ex) { Trace.Error($"Catch exception while attempting to complete job {message.JobId}, job request {message.RequestId}."); Trace.Error(ex);