Skip to content

Commit

Permalink
Merged PR 750781: Fix retry logic for low disk space
Browse files Browse the repository at this point in the history
When there is a low disk space, we cancel PipQueue and running pips by triggering SchedulerCancellationToken. The pips get cancelled and they have SandboxedProcessPipExecutionStatus.Canceled. However, we do not set RetryInfo for those pips, so Canceled sandboxed result is translated to PipResultStatus.Failed due to the lack of RetryInfo. The orchestrator receives pip results with Failed with no error logs, so we log DistributionPipFailedOnWorker errors.

We should have set RetryInfo for those cancelled pips. Because we check environment.Context.CancellationToken instead of SchedulerCancellationToken, we skip setting RetryInfo. Context.CancellationToken is triggered when CTRL-C is pressed. SchedulerCancellationToken is triggered when we request termination in Scheduler.

Related work items: #2121638
  • Loading branch information
semihokur authored and narasamdya committed Nov 9, 2023
1 parent ac8d185 commit 325c30c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Public/Src/Engine/Scheduler/PipExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2215,7 +2215,7 @@ private static async Task<SandboxedProcessPipExecutionResult> ExecutePipAndHandl
expectedCommitMb: expectedMemoryCounters.PeakCommitSizeMb,
cancelMilliseconds: (int)(cancelTime?.TotalMilliseconds ?? 0));
}
else if (environment.Context.CancellationToken.IsCancellationRequested
else if (environment.SchedulerCancellationToken.IsCancellationRequested
&& environment.Configuration.Distribution.BuildRole == DistributedBuildRoles.Worker)
{
// The pip was cancelled due to the scheduler terminating on this distributed worker.
Expand Down

0 comments on commit 325c30c

Please sign in to comment.