diff --git a/src/ModularPipelines/Engine/Executors/PrintProgressExecutor.cs b/src/ModularPipelines/Engine/Executors/PrintProgressExecutor.cs index 520d06bf84..5d677d8512 100644 --- a/src/ModularPipelines/Engine/Executors/PrintProgressExecutor.cs +++ b/src/ModularPipelines/Engine/Executors/PrintProgressExecutor.cs @@ -46,7 +46,14 @@ public async Task InitializeAsync() public async ValueTask DisposeAsync() { - _printProgressCancellationTokenSource?.CancelAfter(ProgressPrinterGracePeriodMs); + try + { + _printProgressCancellationTokenSource?.CancelAfter(ProgressPrinterGracePeriodMs); + } + catch (ObjectDisposedException) + { + // Linked CancellationTokenSource may already be disposed if the engine token was cancelled + } await SafelyAwaitProgressPrinter().ConfigureAwait(false);