From b8f14d39bffd11f65b4fc140a69d5413b7c53d8d Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 15 Jul 2024 18:18:59 -0700 Subject: [PATCH] Fix issue with cancelling AsyncBatchingWorkQueue This was simply a mistake on my part. We should not assume that code is unreachable when it is reached because an OperationCanceledException is caught. --- .../Utilities/AsyncBatchingWorkQueue`2.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities/AsyncBatchingWorkQueue`2.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities/AsyncBatchingWorkQueue`2.cs index 2565ce36abc..23fb11979b7 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities/AsyncBatchingWorkQueue`2.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities/AsyncBatchingWorkQueue`2.cs @@ -271,9 +271,8 @@ void AddItemsToBatch(IEnumerable items) catch (OperationCanceledException) { // Silently continue to allow the next batch to be processed. + return default; } - - return Assumed.Unreachable(); } private (ImmutableArray items, CancellationToken batchCancellationToken) GetNextBatchAndResetQueue()