547 references to IsCancellationRequested
aspire (35)
Backchannel\TrayWatchStream.cs (2)
337if (resolved[index] || snapshotTimeout.IsCancellationRequested || !TryBeginDashboardLookup(connection)) 389if (snapshotTimeout.IsCancellationRequested)
Commands\BaseCommand.cs (1)
349catch (OperationCanceledException) when (flushCancellationTokenSource.IsCancellationRequested)
Commands\DashboardRunCommand.cs (1)
450catch (OperationCanceledException) when (timeoutCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Commands\InstallationInfoOutput.cs (1)
48catch (OperationCanceledException) when (timeoutCts.IsCancellationRequested)
Commands\RunCommand.cs (1)
1341catch (Exception) when (enumerationCancellationSource.IsCancellationRequested)
Commands\StopCommand.cs (2)
805: timeoutCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested ? ResourceTeardownOutcome.TimedOut 808catch (OperationCanceledException) when (timeoutCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Commands\TerminalTapePlayCommand.cs (1)
211catch (OperationCanceledException) when (deadline.IsCancellationRequested)
Commands\TestCommand.cs (4)
125catch (OperationCanceledException) when (executionCancellation.IsCancellationRequested) 166else if (deadline.IsCancellationRequested) 359catch (OperationCanceledException) when (runCancellation.IsCancellationRequested) 696catch (Exception) when (enumerationCancellationSource.IsCancellationRequested)
Commands\TrayLifecycleService.cs (1)
142catch (OperationCanceledException) when (timeout.IsCancellationRequested && (start || !cancellationToken.IsCancellationRequested))
Configuration\ConfigSourceService.cs (3)
94if (_check is not null || _stopping.IsCancellationRequested || executionContext.Command is UpdateCommand { IsConfigSourceRefresh: true }) 97_check is not null, _stopping.IsCancellationRequested, executionContext.Command is UpdateCommand { IsConfigSourceRefresh: true }); 109catch (OperationCanceledException) when (cancellation.IsCancellationRequested)
ConsoleCancellationManager.cs (1)
176public bool IsCancellationRequested => _cts.IsCancellationRequested;
Processes\LauncherLivenessMonitor.cs (1)
62if (!cancelOnLauncherExit.IsCancellationRequested)
Profiling\ProfileCaptureService.cs (4)
300catch (OperationCanceledException) when (timeoutCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 315catch (OperationCanceledException) when (timeoutCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 432catch (OperationCanceledException) when (timeoutCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 441catch (OperationCanceledException) when (timeoutCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Projects\ProjectLocator.cs (2)
224catch (OperationCanceledException) when (discoveryCancellationTokenSource.IsCancellationRequested) 466catch (OperationCanceledException) when (validationCancellationTokenSource?.IsCancellationRequested is true && !cancellationToken.IsCancellationRequested)
src\Shared\ChildProcess.cs (1)
459catch (OperationCanceledException ex) when (deadline.IsCancellationRequested)
src\Shared\Telemetry\InternalMicrosoftDetector.cs (2)
308catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && stageTimeout.IsCancellationRequested) 956catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && timeoutSource.IsCancellationRequested)
Telemetry\AspireCliTelemetry.cs (1)
313catch (OperationCanceledException) when (timeoutSource?.IsCancellationRequested == true)
Templating\TemplateEngineFactory.cs (1)
270catch (OperationCanceledException) when (deadline.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Tui\TerminalViewerApp.cs (1)
242catch (OperationCanceledException) when (_outerCts.IsCancellationRequested)
Utils\EnvironmentChecker\EnvironmentChecker.cs (2)
99catch (OperationCanceledException) when (totalTimeoutCts.IsCancellationRequested) 113catch (OperationCanceledException) when (checkTimeoutCts.IsCancellationRequested)
Utils\ProcessCaptureRunner.cs (2)
113catch (OperationCanceledException) when (timeoutCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 238catch (OperationCanceledException) when (cts.IsCancellationRequested)
aspire-managed (4)
Program.cs (1)
53catch (OperationCanceledException) when (shutdownCts.IsCancellationRequested)
src\Shared\ParentProcessWatchdog.cs (1)
105if (!operationCts.IsCancellationRequested)
TerminalHostForwarder.cs (2)
67catch (OperationCanceledException) when (shutdownCts.IsCancellationRequested) 112context.Cancel = !shutdownCts.IsCancellationRequested;
aspire-tray (18)
src\Aspire.Tray\Common\CliAppHostClient.cs (1)
156catch (OperationCanceledException) when (streams.IsCancellationRequested)
src\Aspire.Tray\Common\CliAppHostCommands.cs (4)
84catch (OperationCanceledException) when (deadline.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 98catch (OperationCanceledException) when (lifetime.IsCancellationRequested) 134catch (OperationCanceledException) when (deadline.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 150catch (OperationCanceledException) when (lifetime.IsCancellationRequested)
src\Aspire.Tray\Common\TrayActivation.cs (4)
106while (!_shutdown.IsCancellationRequested) 161catch (OperationCanceledException) when (request.IsCancellationRequested) 163if (!_shutdown.IsCancellationRequested) 178catch (OperationCanceledException) when (_shutdown.IsCancellationRequested)
src\Aspire.Tray\Common\TrayController.cs (5)
285if (!_shutdown.IsCancellationRequested && State.Discovery is not (DiscoveryState.Incompatible or DiscoveryState.LimitExceeded)) 291catch (OperationCanceledException) when (_shutdown.IsCancellationRequested) 374catch (OperationCanceledException) when (_shutdown.IsCancellationRequested) 416catch (OperationCanceledException) when (_shutdown.IsCancellationRequested) 466catch (OperationCanceledException) when (_shutdown.IsCancellationRequested)
src\Aspire.Tray\Common\WindowsLoginBootstrap.cs (3)
43catch (OperationCanceledException) when (timeout.IsCancellationRequested) 61catch (OperationCanceledException) when (termination.IsCancellationRequested) 74catch (OperationCanceledException) when (timeout.IsCancellationRequested)
WindowsTrayLauncher.cs (1)
100catch (OperationCanceledException) when (timeout.IsCancellationRequested)
Aspire.Acquisition.Tests (1)
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
93catch (TaskCanceledException tce) when (cts.IsCancellationRequested)
Aspire.Cli.EndToEnd.Tests (4)
Helpers\TerminalRun.cs (1)
111catch (OperationCanceledException) when (runCancellation.IsCancellationRequested)
SmokeTests.cs (3)
311Assert.False(runCancellation.IsCancellationRequested); 323Assert.True(runCancellation.IsCancellationRequested); 339Assert.True(runCancellation.IsCancellationRequested);
Aspire.Cli.Tests (18)
Backchannel\AuxiliaryBackchannelMonitorTests.cs (1)
108catch (OperationCanceledException) when (cancellation.IsCancellationRequested)
Backchannel\ResourceSnapshotWatcherTests.cs (1)
454catch (OperationCanceledException) when (consumersCts.IsCancellationRequested)
Commands\RunCommandTests.cs (2)
2105Assert.True(cts.IsCancellationRequested, "The dashboard RPC must request cancellation synchronously."); 2176Assert.True(cts.IsCancellationRequested, "The dashboard RPC must request cancellation synchronously.");
Configuration\ConfigSourceServiceTests.cs (1)
448Assert.False(cancellation.IsCancellationRequested);
Processes\LauncherLivenessMonitorTests.cs (5)
25Assert.False(runCts.IsCancellationRequested); 46Assert.True(runCts.IsCancellationRequested); 68Assert.False(runCts.IsCancellationRequested); 71Assert.False(runCts.IsCancellationRequested); 92Assert.False(runCts.IsCancellationRequested);
Projects\GuestAppHostProjectTests.cs (1)
2039catch (OperationCanceledException) when (cancellationSource.IsCancellationRequested)
Projects\GuestRuntimeTests.cs (1)
1060Assert.False(cts.IsCancellationRequested,
tests\Shared\TemporaryWorkspaceGitExtensions.cs (2)
100outputHelper.WriteLine($"[{DateTimeOffset.UtcNow:O}] '{command}' (PID {process.Id}) {(timeout.IsCancellationRequested ? "timed out" : "was canceled")} after {stopwatch.Elapsed}"); 101if (timeout.IsCancellationRequested && !cancellationToken.IsCancellationRequested && !TestContext.Current.CancellationToken.IsCancellationRequested)
TestServices\FakeDcpApiServer.cs (1)
113catch (OperationCanceledException) when (_shutdown.IsCancellationRequested)
TestServices\GitAuthenticationServer.cs (1)
47catch (OperationCanceledException) when (_shutdown.IsCancellationRequested)
TestServices\TerminalTapeTestHost.cs (2)
64while (!_stopping.IsCancellationRequested) 113catch (OperationCanceledException) when (_stopping.IsCancellationRequested)
Aspire.Dashboard (24)
Components\Controls\ApplicationName.razor.cs (1)
44catch (OperationCanceledException) when (!_disposalCts.IsCancellationRequested)
Components\Controls\MissingParametersPanel.razor.cs (1)
320if (!_disposalCts.IsCancellationRequested && ReferenceEquals(deferred, Interaction))
Components\Dialogs\FilterDialog.razor.cs (2)
126catch (OperationCanceledException) when (_disposeCts.IsCancellationRequested) 244catch (OperationCanceledException) when (_disposeCts.IsCancellationRequested)
Components\Dialogs\InteractionsInputDialog.razor.cs (1)
336if (!_disposalCts.IsCancellationRequested)
Components\Interactions\InteractionsProvider.cs (7)
135catch (Exception ex) when (!_cts.IsCancellationRequested) 147catch (Exception ex) when (!_cts.IsCancellationRequested) 158while (!_cts.IsCancellationRequested) 430catch (OperationCanceledException) when (_cts.IsCancellationRequested) 622catch (OperationCanceledException) when (_cts.IsCancellationRequested) 679catch (OperationCanceledException) when (_cts.IsCancellationRequested) 766ignoreResult: () => _cts.IsCancellationRequested ||
Components\Layout\ResourcesLayout.Activity.cs (3)
97if (!_isPaneFullCanvas || !_paneActivityVisible || generation != _paneActivityGeneration || queryCancellation.IsCancellationRequested) 150catch (OperationCanceledException) when (queryCancellation.IsCancellationRequested) 152if (timeout.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Components\Layout\TerminalDock.razor.cs (1)
439catch (Exception ex) when (_cts.IsCancellationRequested && (ex is OperationCanceledException || ex is RpcException { StatusCode: StatusCode.Cancelled }))
Model\DashboardCommandExecutor.cs (1)
191catch (OperationCanceledException) when (executeCommandCts.IsCancellationRequested)
Model\ResourceOutgoingPeerResolver.cs (1)
327if (_watchContainersTokenSource.IsCancellationRequested)
Model\TraceLinkHelpers.cs (1)
62while (!cts.IsCancellationRequested)
src\Shared\ChildProcess.cs (1)
459catch (OperationCanceledException ex) when (deadline.IsCancellationRequested)
src\Shared\ParentProcessWatchdog.cs (1)
105if (!operationCts.IsCancellationRequested)
src\Shared\Telemetry\InternalMicrosoftDetector.cs (2)
308catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && stageTimeout.IsCancellationRequested) 956catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && timeoutSource.IsCancellationRequested)
Terminal\TerminalWebSocketProxy.cs (1)
359catch (OperationCanceledException) when (!stopping.IsCancellationRequested)
Aspire.Dashboard.Playwright.Tests (2)
Integration\Playwright\NativeAotDashboardTests.cs (1)
214catch (OperationCanceledException) when (timeout.IsCancellationRequested)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
26while (foundRows.Count < expectedRows.Count && !cts.IsCancellationRequested)
Aspire.Deployment.EndToEnd.Tests (7)
AcaExpressDeploymentTests.cs (2)
129catch (OperationCanceledException) when (terminalCancellation.IsCancellationRequested) 380catch (OperationCanceledException) when (!readiness.IsCancellationRequested)
AksCrossResourceGroupRegistryDeploymentTests.cs (1)
246catch (OperationCanceledException) when (terminalCancellation.IsCancellationRequested)
FoundryDotnetProjectDeploymentTests.cs (1)
138catch (Exception ex) when (ex is ClientResultException || ex is OperationCanceledException && !cts.IsCancellationRequested)
Helpers\EntraDeploymentHelpers.cs (1)
149catch (OperationCanceledException) when (terminalCancellation.IsCancellationRequested)
RadiusStarterDeploymentTests.cs (1)
688catch (OperationCanceledException) when (waitCts.IsCancellationRequested)
TypeScriptAzureProvisioningDeploymentTests.cs (1)
174catch (OperationCanceledException) when (terminalCancellation.IsCancellationRequested)
Aspire.EndToEnd.Tests (2)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
26while (foundRows.Count < expectedRows.Count && !cts.IsCancellationRequested)
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
93catch (TaskCanceledException tce) when (cts.IsCancellationRequested)
Aspire.Hosting (31)
ApplicationModel\ConcurrentValueResolver.cs (2)
50for (; startedCount < reads.Length && !failureCts.IsCancellationRequested; startedCount++) 104var isFault = ex is not OperationCanceledException || !failureCts.IsCancellationRequested;
ApplicationModel\ResourceLoggerService.cs (3)
561if (_logStreamCts.IsCancellationRequested) 667return !_logStreamCts.IsCancellationRequested && HasSubscribers; 864if (loggerState._logStreamCts.IsCancellationRequested)
Backchannel\AppHostRpcTarget.cs (3)
35if (_shutdownCts.IsCancellationRequested) 77if (_shutdownCts.IsCancellationRequested) 114if (_shutdownCts.IsCancellationRequested)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
749catch (OperationCanceledException) when (timeoutCts.IsCancellationRequested)
Cli\TestRunCoordinator.cs (4)
97catch (OperationCanceledException) when (_runCancellation.IsCancellationRequested) 180catch (OperationCanceledException) when (stop.IsCancellationRequested) 321catch (OperationCanceledException ex) when (deadline?.IsCancellationRequested is true) 392catch (OperationCanceledException) when (timeout.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Dcp\DcpHost.cs (2)
112catch (OperationCanceledException) when (timeoutCancellation.IsCancellationRequested) 544while (!_shutdownCts.IsCancellationRequested)
Dcp\DcpKubernetesClient.cs (1)
245catch (Exception) when (linkedCts.IsCancellationRequested)
Dcp\DcpResourceWatcher.cs (2)
523catch (OperationCanceledException) when (timeoutCts.IsCancellationRequested) 1184if (_disposed || _cancellation.IsCancellationRequested)
Dcp\KubernetesService.cs (1)
349catch (OperationCanceledException) when (watchCts.IsCancellationRequested)
Dcp\Process\ProcessUtil.cs (1)
119catch (OperationCanceledException ex) when (inputCancellation.IsCancellationRequested)
Devcontainers\DevcontainerSettingsWriter.cs (2)
85catch (OperationCanceledException) when (_processingCancellation.IsCancellationRequested) 96catch (OperationCanceledException) when (_processingCancellation.IsCancellationRequested)
InteractionService.cs (1)
387catch (OperationCanceledException) when (interactionCts.IsCancellationRequested)
Orchestrator\ParameterProcessor.cs (3)
99catch (OperationCanceledException) when (cts.IsCancellationRequested) 112canRestart = !failed || cts.IsCancellationRequested; 898if (unresolvedParameters.Count == 0 && _allParametersResolvedCts is { IsCancellationRequested: false } cts)
Pipelines\PipelineActivityReporter.cs (1)
504if (!_cancellationTokenSource.IsCancellationRequested)
Utils\PeriodicRestartAsyncEnumerable.cs (4)
34catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token && cts.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 55catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token && cts.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 100catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token && cts.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 121catch (OperationCanceledException ex) when (ex.CancellationToken == cts.Token && cts.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Aspire.Hosting.Azure (6)
AzureProvisioningController.cs (1)
4471public bool CancellationRequested => _cancellationTokenSource.IsCancellationRequested;
Provisioning\Internal\DefaultArmClientProvider.cs (4)
285catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && timeoutCts.IsCancellationRequested) 294catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && timeoutCts.IsCancellationRequested) 316catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && timeoutCts.IsCancellationRequested) 325catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && timeoutCts.IsCancellationRequested)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (1)
119catch (OperationCanceledException ex) when (inputCancellation.IsCancellationRequested)
Aspire.Hosting.Azure.Tests (3)
AzureEnvironmentResourceExtensionsTests.cs (3)
5721catch (OperationCanceledException) when (watchdog.IsCancellationRequested) 5744while (!watchdog.IsCancellationRequested) 5756catch (OperationCanceledException) when (watchdog.IsCancellationRequested)
Aspire.Hosting.Browsers (9)
BrowserLogsCdpConnection.cs (4)
264catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && !_disposeCts.IsCancellationRequested) 280while (!_disposeCts.IsCancellationRequested) 298catch (OperationCanceledException) when (_disposeCts.IsCancellationRequested) 317if (!_disposeCts.IsCancellationRequested)
BrowserPageSession.cs (4)
360if (_stopCts.IsCancellationRequested) 393while (!_stopCts.IsCancellationRequested && _timeProvider.GetUtcNow() < reconnectDeadline) 408catch (OperationCanceledException) when (_stopCts.IsCancellationRequested) 424catch (OperationCanceledException) when (_stopCts.IsCancellationRequested)
IBrowserHost.cs (1)
111catch (OperationCanceledException) when (releaseCts.IsCancellationRequested)
Aspire.Hosting.Browsers.Tests (9)
src\Aspire.Hosting.Browsers\BrowserLogsCdpConnection.cs (4)
264catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && !_disposeCts.IsCancellationRequested) 280while (!_disposeCts.IsCancellationRequested) 298catch (OperationCanceledException) when (_disposeCts.IsCancellationRequested) 317if (!_disposeCts.IsCancellationRequested)
src\Aspire.Hosting.Browsers\BrowserPageSession.cs (4)
360if (_stopCts.IsCancellationRequested) 393while (!_stopCts.IsCancellationRequested && _timeProvider.GetUtcNow() < reconnectDeadline) 408catch (OperationCanceledException) when (_stopCts.IsCancellationRequested) 424catch (OperationCanceledException) when (_stopCts.IsCancellationRequested)
src\Aspire.Hosting.Browsers\IBrowserHost.cs (1)
111catch (OperationCanceledException) when (releaseCts.IsCancellationRequested)
Aspire.Hosting.DevTunnels (5)
DevTunnelMonitor.cs (5)
192catch (OperationCanceledException) when (run.Cancellation.IsCancellationRequested) 416if (!run.Cancellation.IsCancellationRequested) 421catch (OperationCanceledException) when (run.Cancellation.IsCancellationRequested) 453catch (OperationCanceledException) when (run.Cancellation.IsCancellationRequested) 700&& !run.Cancellation.IsCancellationRequested
Aspire.Hosting.DevTunnels.Tests (1)
DevTunnelCliClientTests.cs (1)
421Assert.False(cts.IsCancellationRequested);
Aspire.Hosting.Docker (1)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (1)
119catch (OperationCanceledException ex) when (inputCancellation.IsCancellationRequested)
Aspire.Hosting.Dotnet (1)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (1)
119catch (OperationCanceledException ex) when (inputCancellation.IsCancellationRequested)
Aspire.Hosting.Kubernetes (1)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (1)
119catch (OperationCanceledException ex) when (inputCancellation.IsCancellationRequested)
Aspire.Hosting.Maui (1)
Lifecycle\MauiBuildQueueEventSubscriber.cs (1)
147catch (OperationCanceledException ex) when (resourceCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Aspire.Hosting.MongoDB (3)
MongoDBSingleMemberReplicaSet.cs (2)
71catch (OperationCanceledException) when (!stopping.IsCancellationRequested) 86catch (OperationCanceledException) when (stopping.IsCancellationRequested)
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (1)
600catch (OperationCanceledException) when (timeout.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Aspire.Hosting.MongoDB.Tests (1)
tests\Shared\ContainerReplCommandTestBase.cs (1)
183catch (OperationCanceledException exception) when (cancellation.IsCancellationRequested)
Aspire.Hosting.MySql.Tests (1)
tests\Shared\ContainerReplCommandTestBase.cs (1)
183catch (OperationCanceledException exception) when (cancellation.IsCancellationRequested)
Aspire.Hosting.Native.Client (3)
Authoring\NativeApplication.cs (1)
321catch (OperationCanceledException) when (lifetime.IsCancellationRequested)
Authoring\NativePipeline.cs (2)
131if (!lifetime.IsCancellationRequested) 170await server.CompletePublishingAsync(failure is not null || lifetime.IsCancellationRequested &&
Aspire.Hosting.Native.Core (3)
Runtime\ResourceWorkload.cs (1)
312catch (OperationCanceledException) when (_lifetime.IsCancellationRequested)
Runtime\RuntimeGeneration.cs (1)
234catch (OperationCanceledException) when (timeout.IsCancellationRequested)
Runtime\TimeProviderCancellation.cs (1)
19public bool IsCancellationRequested => _linked.IsCancellationRequested;
Aspire.Hosting.Native.Core.Tests (2)
SocketConnectionListenerTests.cs (1)
73Assert.True(cancellation.IsCancellationRequested);
TestServices\NativeActivationRpcTestHost.cs (1)
51catch (OperationCanceledException) when (_lifetime.IsCancellationRequested)
Aspire.Hosting.Native.Server (24)
Auxiliary\NativeAuxiliaryBackchannel.cs (1)
473catch (OperationCanceledException) when (timeout.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Dashboard\NativeDashboardHost.cs (1)
61if (requests.IsCancellationRequested)
Dashboard\NativeDashboardService.cs (2)
216catch (OperationCanceledException) when (lifetime.IsCancellationRequested) 225while (!lifetime.IsCancellationRequested)
NativeServerHostedService.cs (3)
183catch (OperationCanceledException) when (shutdown.IsCancellationRequested) 249catch (OperationCanceledException) when (shutdown.IsCancellationRequested) 265catch (OperationCanceledException) when (shutdown.IsCancellationRequested)
Rpc\NativeBackchannelRpc.cs (5)
75catch (OperationCanceledException) when (lifetime.IsCancellationRequested) 167catch (OperationCanceledException) when (cancellation.IsCancellationRequested || lifetime.IsCancellationRequested || nextCursor?.IsDisposed == true) 190if (lifetime.IsCancellationRequested) 201catch (OperationCanceledException) when (lifetime.IsCancellationRequested)
Rpc\NativeProviderLifecycle.cs (1)
104deadline.IsCancellationRequested ? RpcFault.ProviderLifecycleTimeout(message) : RpcFault.ProviderLifecycleFailed(message);
Rpc\NativeRpcListener.cs (2)
120while (!lifetime.IsCancellationRequested) 134catch (OperationCanceledException) when (lifetime.IsCancellationRequested)
Rpc\NativeRpcPeer.cs (5)
59catch (OperationCanceledException) when (deadline.IsCancellationRequested && !cancellationToken.IsCancellationRequested && !_closed.IsCancellationRequested) 128catch (OperationCanceledException) when (lifetime.IsCancellationRequested) 143if (response is null || lifetime.IsCancellationRequested) 202if (_closed.IsCancellationRequested)
Transport\SocketConnectionListener.cs (4)
29while (!lifetime.IsCancellationRequested) 36catch (SocketException ex) when (ex.SocketErrorCode == SocketError.OperationAborted && lifetime.IsCancellationRequested) 61catch (OperationCanceledException) when (lifetime.IsCancellationRequested) 77catch (OperationCanceledException) when (lifetime.IsCancellationRequested)
Aspire.Hosting.PostgreSQL.Tests (1)
tests\Shared\ContainerReplCommandTestBase.cs (1)
183catch (OperationCanceledException exception) when (cancellation.IsCancellationRequested)
Aspire.Hosting.Radius (1)
Publishing\SealedSecretApplyStep.cs (1)
344catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && timeoutCts.IsCancellationRequested)
Aspire.Hosting.Redis.Tests (1)
tests\Shared\ContainerReplCommandTestBase.cs (1)
183catch (OperationCanceledException exception) when (cancellation.IsCancellationRequested)
Aspire.Hosting.RemoteHost (3)
Ats\ExternalCapabilityRegistry.cs (1)
520catch (OperationCanceledException) when (invocationCancellation.IsCancellationRequested)
Language\IntegrationHostLauncher.cs (1)
109catch (OperationCanceledException ex) when (initializationCancellation.IsCancellationRequested)
src\Shared\ChildProcess.cs (1)
459catch (OperationCanceledException ex) when (deadline.IsCancellationRequested)
Aspire.Hosting.SqlServer.Tests (1)
tests\Shared\ContainerReplCommandTestBase.cs (1)
183catch (OperationCanceledException exception) when (cancellation.IsCancellationRequested)
Aspire.Hosting.Testing (8)
DistributedApplicationFactory.cs (8)
47ObjectDisposedException.ThrowIf(_disposingCts.IsCancellationRequested, this); 70ObjectDisposedException.ThrowIf(_disposingCts.IsCancellationRequested, this); 84ObjectDisposedException.ThrowIf(_disposingCts.IsCancellationRequested, this); 98ObjectDisposedException.ThrowIf(_disposingCts.IsCancellationRequested, this); 114ObjectDisposedException.ThrowIf(_disposingCts.IsCancellationRequested, this); 502if (_disposingCts.IsCancellationRequested) 538catch (OperationCanceledException) when (_disposingCts.IsCancellationRequested) 547catch (OperationCanceledException) when (_disposingCts.IsCancellationRequested)
Aspire.Hosting.Testing.Tests (2)
TestingBuilderTests.cs (1)
604Assert.False(cts.IsCancellationRequested);
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
26while (foundRows.Count < expectedRows.Count && !cts.IsCancellationRequested)
Aspire.Hosting.Tests (20)
AddParameterTests.cs (2)
140Assert.False(cts.IsCancellationRequested); 170Assert.False(cts.IsCancellationRequested);
Cli\TestingCollectorTests.cs (3)
992Assert.False(caller.IsCancellationRequested); 1013Assert.False(run.IsCancellationRequested); 1036Assert.False(run.IsCancellationRequested);
Cli\TestRunCoordinatorEndToEndTests.cs (1)
166Assert.False(caller.IsCancellationRequested);
Cli\TestRunCoordinatorTests.cs (1)
199catch (OperationCanceledException) when (cancellation.IsCancellationRequested)
Dashboard\DashboardServiceTests.cs (1)
1861catch (OperationCanceledException) when (clientCts.IsCancellationRequested)
Dcp\KubernetesServiceTests.cs (4)
170catch (OperationCanceledException) when (watchCts.IsCancellationRequested) 271catch (OperationCanceledException) when (cts.IsCancellationRequested) 334catch (OperationCanceledException) when (watchCts.IsCancellationRequested) 813catch (OperationCanceledException) when (cts.IsCancellationRequested)
DistributedApplicationTests.cs (1)
868while (!cts.IsCancellationRequested)
Pipelines\PipelineOutputComparisonTests.cs (2)
127Assert.True(cts.IsCancellationRequested); 150Assert.True(cts.IsCancellationRequested);
Pipelines\PipelineOutputResolutionTests.cs (1)
182Assert.False(cancellation.IsCancellationRequested);
Terminals\Hex1bAspireTerminalTests.cs (1)
521catch (OperationCanceledException) when (clientCts.IsCancellationRequested)
Terminals\TerminalServiceTests.cs (1)
838catch (OperationCanceledException) when (stopCts.IsCancellationRequested)
Utils\TestAppHostTerminalViewer.cs (1)
94catch (OperationCanceledException) when (_clientCts.IsCancellationRequested)
Utils\TestResourceTerminalHost.cs (1)
73catch (OperationCanceledException) when (_cts.IsCancellationRequested)
Aspire.Hosting.Valkey.Tests (1)
tests\Shared\ContainerReplCommandTestBase.cs (1)
183catch (OperationCanceledException exception) when (cancellation.IsCancellationRequested)
Aspire.Managed.Tests (1)
ParentProcessWatchdogTests.cs (1)
53Assert.True(operationCts.IsCancellationRequested);
Aspire.Playground.Tests (1)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
26while (foundRows.Count < expectedRows.Count && !cts.IsCancellationRequested)
Aspire.Templates.Tests (2)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
26while (foundRows.Count < expectedRows.Count && !cts.IsCancellationRequested)
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
93catch (TaskCanceledException tce) when (cts.IsCancellationRequested)
Aspire.TerminalHost (3)
DcpUpstreamAdapter.cs (1)
222catch (OperationCanceledException) when (_disposeCts.IsCancellationRequested)
src\Shared\ParentProcessWatchdog.cs (1)
105if (!operationCts.IsCancellationRequested)
TerminalHostApp.cs (1)
209if (!_shutdownCts.IsCancellationRequested)
Aspire.Tray.Tests (22)
CliAppHostCommandsTests.cs (2)
122catch (OperationCanceledException) when (shutdown.IsCancellationRequested) 301catch (OperationCanceledException) when (shutdown.IsCancellationRequested)
src\Aspire.Tray\Common\CliAppHostClient.cs (1)
156catch (OperationCanceledException) when (streams.IsCancellationRequested)
src\Aspire.Tray\Common\CliAppHostCommands.cs (4)
84catch (OperationCanceledException) when (deadline.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 98catch (OperationCanceledException) when (lifetime.IsCancellationRequested) 134catch (OperationCanceledException) when (deadline.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 150catch (OperationCanceledException) when (lifetime.IsCancellationRequested)
src\Aspire.Tray\Common\TrayActivation.cs (4)
106while (!_shutdown.IsCancellationRequested) 161catch (OperationCanceledException) when (request.IsCancellationRequested) 163if (!_shutdown.IsCancellationRequested) 178catch (OperationCanceledException) when (_shutdown.IsCancellationRequested)
src\Aspire.Tray\Common\TrayController.cs (5)
285if (!_shutdown.IsCancellationRequested && State.Discovery is not (DiscoveryState.Incompatible or DiscoveryState.LimitExceeded)) 291catch (OperationCanceledException) when (_shutdown.IsCancellationRequested) 374catch (OperationCanceledException) when (_shutdown.IsCancellationRequested) 416catch (OperationCanceledException) when (_shutdown.IsCancellationRequested) 466catch (OperationCanceledException) when (_shutdown.IsCancellationRequested)
src\Aspire.Tray\Common\WindowsLoginBootstrap.cs (3)
43catch (OperationCanceledException) when (timeout.IsCancellationRequested) 61catch (OperationCanceledException) when (termination.IsCancellationRequested) 74catch (OperationCanceledException) when (timeout.IsCancellationRequested)
src\Aspire.Tray\Linux\LinuxTrayRuntime.cs (1)
239catch (OperationCanceledException) when (timeout.IsCancellationRequested)
src\Aspire.Tray\Mac\MacDetachedProcess.cs (1)
109catch (OperationCanceledException) when (timeout.IsCancellationRequested)
src\Aspire.Tray\Windows\WindowsTrayLauncher.cs (1)
100catch (OperationCanceledException) when (timeout.IsCancellationRequested)
dotnet-openapi (1)
Commands\BaseCommand.cs (1)
238catch (OperationCanceledException) when (timeoutSource.IsCancellationRequested)
GenerateDocumentationAndConfigFiles (14)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (7)
141if (_entireQueueCancellationTokenSource.IsCancellationRequested) 166if (_entireQueueCancellationTokenSource.IsCancellationRequested) 188if (_entireQueueCancellationTokenSource.IsCancellationRequested) 237if (_entireQueueCancellationTokenSource.IsCancellationRequested) 248if (_entireQueueCancellationTokenSource.IsCancellationRequested) 271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested); 293else if (batchResultTask.IsCanceled && !_entireQueueCancellationTokenSource.IsCancellationRequested)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
103if (_entireQueueCancellationTokenSource.IsCancellationRequested) 125if (_entireQueueCancellationTokenSource.IsCancellationRequested) 142if (_entireQueueCancellationTokenSource.IsCancellationRequested) 200if (_entireQueueCancellationTokenSource.IsCancellationRequested) 211if (_entireQueueCancellationTokenSource.IsCancellationRequested) 282if (_entireQueueCancellationTokenSource.IsCancellationRequested)
Infrastructure.Common (3)
xunit\WcfTestRunner.cs (3)
51if (!attemptAggregator.HasExceptions || attempt >= _maxAttempts || CancellationTokenSource.IsCancellationRequested) 67catch (OperationCanceledException) when (CancellationTokenSource.IsCancellationRequested) 73if (CancellationTokenSource.IsCancellationRequested)
Infrastructure.Tests (3)
ExecutableFileTests.cs (1)
26while (!stop.IsCancellationRequested)
PowerShellScripts\PowerShellCommand.cs (1)
68catch (TaskCanceledException tce) when (cts.IsCancellationRequested)
WorkflowScripts\NodeCommand.cs (1)
62catch (TaskCanceledException tce) when (cts.IsCancellationRequested)
Microsoft.AspNetCore.Components.Forms (1)
EditContext.cs (1)
549catch (OperationCanceledException) when (cts.IsCancellationRequested)
Microsoft.AspNetCore.Components.QuickGrid (1)
QuickGrid.razor.cs (1)
541if (!thisLoadCts.IsCancellationRequested)
Microsoft.AspNetCore.Hosting (1)
Internal\WebHostLifetime.cs (1)
58if (!_cts.IsCancellationRequested)
Microsoft.AspNetCore.Http (1)
Timeouts\RequestTimeoutsMiddleware.cs (1)
110when (linkedCts.IsCancellationRequested && !originalToken.IsCancellationRequested)
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionContext.cs (1)
1118if (_sendCts == null || _sendCts.IsCancellationRequested)
Microsoft.AspNetCore.HttpLogging (1)
FileLoggerProcessor.cs (1)
121while (!_cancellationTokenSource.IsCancellationRequested)
Microsoft.AspNetCore.Session (3)
DistributedSession.cs (3)
232catch (OperationCanceledException oex) when (!cancellationToken.IsCancellationRequested && cts.IsCancellationRequested) 287catch (OperationCanceledException oex) when (!cancellationToken.IsCancellationRequested && cts.IsCancellationRequested) 299catch (OperationCanceledException oex) when (!cancellationToken.IsCancellationRequested && cts.IsCancellationRequested)
Microsoft.AspNetCore.SignalR.Client.Core (2)
HubConnection.cs (2)
1895if (handshakeCts.IsCancellationRequested) 2203if (_state.StopCts.IsCancellationRequested)
Microsoft.AspNetCore.SignalR.Core (2)
HubConnectionContext.cs (1)
627if (_connectionAbortedTokenSource.IsCancellationRequested)
Internal\DefaultHubDispatcher.cs (1)
669if (!(ex is OperationCanceledException && streamCts.IsCancellationRequested))
Microsoft.Build (4)
BackEnd\BuildManager\BuildManager.cs (1)
1571telemetry.IsCancellationRequested = _executionCancellationTokenSource?.IsCancellationRequested ?? false;
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
1620catch (OperationCanceledException) when (timeout.IsCancellationRequested)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
283if (_cancellationTokenSource.IsCancellationRequested) 1270if (!_cancellationTokenSource.IsCancellationRequested
Microsoft.Build.Tasks.Core (17)
AssemblyDependency\ResolveAssemblyReference.cs (1)
3799if (_cancellationTokenSource.IsCancellationRequested)
Copy.cs (5)
476return success && !_cancellationTokenSource.IsCancellationRequested; 500for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 610for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 664for (int partitionIndex = 0; partitionIndex < partition.Count && !_cancellationTokenSource.IsCancellationRequested; partitionIndex++) 996while (!_cancellationTokenSource.IsCancellationRequested)
DownloadFile.cs (1)
142return !_cancellationTokenSource.IsCancellationRequested && !Log.HasLoggedErrors;
TarTaskBase.cs (3)
201return !_cancellationTokenSource.IsCancellationRequested && !Log.HasLoggedErrors; 680if (_cancellationTokenSource.IsCancellationRequested) 685catch (OperationCanceledException) when (_cancellationTokenSource.IsCancellationRequested)
Untar.cs (4)
152return !_cancellationTokenSource.IsCancellationRequested && !Log.HasLoggedErrors; 162foreach (ITaskItem sourceItem in SourceFiles.TakeWhile(i => !_cancellationTokenSource.IsCancellationRequested)) 298for (TarEntry? tarEntry = reader.GetNextEntry(); tarEntry is not null && !_cancellationTokenSource.IsCancellationRequested; tarEntry = reader.GetNextEntry()) 520if (_cancellationTokenSource.IsCancellationRequested)
Unzip.cs (3)
114foreach (ITaskItem sourceFile in SourceFiles.TakeWhile(i => !_cancellationToken.IsCancellationRequested)) 171return !_cancellationToken.IsCancellationRequested && !Log.HasLoggedErrors; 183foreach (ZipArchiveEntry zipArchiveEntry in sourceArchive.Entries.TakeWhile(i => !_cancellationToken.IsCancellationRequested))
Microsoft.CodeAnalysis.Analyzers (19)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (7)
141if (_entireQueueCancellationTokenSource.IsCancellationRequested) 166if (_entireQueueCancellationTokenSource.IsCancellationRequested) 188if (_entireQueueCancellationTokenSource.IsCancellationRequested) 237if (_entireQueueCancellationTokenSource.IsCancellationRequested) 248if (_entireQueueCancellationTokenSource.IsCancellationRequested) 271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested); 293else if (batchResultTask.IsCanceled && !_entireQueueCancellationTokenSource.IsCancellationRequested)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
131while (!state.Cancellation.IsCancellationRequested) 138if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 296while (!state.Cancellation.IsCancellationRequested) 303if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 540Debug.Assert(!Cancellation.IsCancellationRequested);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
103if (_entireQueueCancellationTokenSource.IsCancellationRequested) 125if (_entireQueueCancellationTokenSource.IsCancellationRequested) 142if (_entireQueueCancellationTokenSource.IsCancellationRequested) 200if (_entireQueueCancellationTokenSource.IsCancellationRequested) 211if (_entireQueueCancellationTokenSource.IsCancellationRequested) 282if (_entireQueueCancellationTokenSource.IsCancellationRequested)
Microsoft.CodeAnalysis.AnalyzerUtilities (19)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (7)
141if (_entireQueueCancellationTokenSource.IsCancellationRequested) 166if (_entireQueueCancellationTokenSource.IsCancellationRequested) 188if (_entireQueueCancellationTokenSource.IsCancellationRequested) 237if (_entireQueueCancellationTokenSource.IsCancellationRequested) 248if (_entireQueueCancellationTokenSource.IsCancellationRequested) 271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested); 293else if (batchResultTask.IsCanceled && !_entireQueueCancellationTokenSource.IsCancellationRequested)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
131while (!state.Cancellation.IsCancellationRequested) 138if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 296while (!state.Cancellation.IsCancellationRequested) 303if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 540Debug.Assert(!Cancellation.IsCancellationRequested);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
103if (_entireQueueCancellationTokenSource.IsCancellationRequested) 125if (_entireQueueCancellationTokenSource.IsCancellationRequested) 142if (_entireQueueCancellationTokenSource.IsCancellationRequested) 200if (_entireQueueCancellationTokenSource.IsCancellationRequested) 211if (_entireQueueCancellationTokenSource.IsCancellationRequested) 282if (_entireQueueCancellationTokenSource.IsCancellationRequested)
Microsoft.CodeAnalysis.CodeStyle (19)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (7)
141if (_entireQueueCancellationTokenSource.IsCancellationRequested) 166if (_entireQueueCancellationTokenSource.IsCancellationRequested) 188if (_entireQueueCancellationTokenSource.IsCancellationRequested) 237if (_entireQueueCancellationTokenSource.IsCancellationRequested) 248if (_entireQueueCancellationTokenSource.IsCancellationRequested) 271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested); 293else if (batchResultTask.IsCanceled && !_entireQueueCancellationTokenSource.IsCancellationRequested)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
131while (!state.Cancellation.IsCancellationRequested) 138if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 296while (!state.Cancellation.IsCancellationRequested) 303if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 540Debug.Assert(!Cancellation.IsCancellationRequested);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
103if (_entireQueueCancellationTokenSource.IsCancellationRequested) 125if (_entireQueueCancellationTokenSource.IsCancellationRequested) 142if (_entireQueueCancellationTokenSource.IsCancellationRequested) 200if (_entireQueueCancellationTokenSource.IsCancellationRequested) 211if (_entireQueueCancellationTokenSource.IsCancellationRequested) 282if (_entireQueueCancellationTokenSource.IsCancellationRequested)
Microsoft.CodeAnalysis.Features.ExternalAccess (1)
Copilot\Internal\SemanticSearch\CopilotSemanticSearchQueryExecutor.cs (1)
131catch (OperationCanceledException) when (cancellationSource.IsCancellationRequested)
Microsoft.CodeAnalysis.ResxSourceGenerator (19)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (7)
141if (_entireQueueCancellationTokenSource.IsCancellationRequested) 166if (_entireQueueCancellationTokenSource.IsCancellationRequested) 188if (_entireQueueCancellationTokenSource.IsCancellationRequested) 237if (_entireQueueCancellationTokenSource.IsCancellationRequested) 248if (_entireQueueCancellationTokenSource.IsCancellationRequested) 271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested); 293else if (batchResultTask.IsCanceled && !_entireQueueCancellationTokenSource.IsCancellationRequested)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
131while (!state.Cancellation.IsCancellationRequested) 138if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 296while (!state.Cancellation.IsCancellationRequested) 303if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 540Debug.Assert(!Cancellation.IsCancellationRequested);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
103if (_entireQueueCancellationTokenSource.IsCancellationRequested) 125if (_entireQueueCancellationTokenSource.IsCancellationRequested) 142if (_entireQueueCancellationTokenSource.IsCancellationRequested) 200if (_entireQueueCancellationTokenSource.IsCancellationRequested) 211if (_entireQueueCancellationTokenSource.IsCancellationRequested) 282if (_entireQueueCancellationTokenSource.IsCancellationRequested)
Microsoft.CodeAnalysis.Workspaces (14)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (7)
141if (_entireQueueCancellationTokenSource.IsCancellationRequested) 166if (_entireQueueCancellationTokenSource.IsCancellationRequested) 188if (_entireQueueCancellationTokenSource.IsCancellationRequested) 237if (_entireQueueCancellationTokenSource.IsCancellationRequested) 248if (_entireQueueCancellationTokenSource.IsCancellationRequested) 271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested); 293else if (batchResultTask.IsCanceled && !_entireQueueCancellationTokenSource.IsCancellationRequested)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
103if (_entireQueueCancellationTokenSource.IsCancellationRequested) 125if (_entireQueueCancellationTokenSource.IsCancellationRequested) 142if (_entireQueueCancellationTokenSource.IsCancellationRequested) 200if (_entireQueueCancellationTokenSource.IsCancellationRequested) 211if (_entireQueueCancellationTokenSource.IsCancellationRequested) 282if (_entireQueueCancellationTokenSource.IsCancellationRequested)
Microsoft.Diagnostics.NETCore.Client (7)
DiagnosticsIpc\IpcServerTransport.cs (2)
147if (!linkedSource.IsCancellationRequested) 216if (!linkedSource.IsCancellationRequested)
DiagnosticsServerRouter\DiagnosticsServerRouterFactory.cs (5)
239if (acceptTimeoutTokenSource.IsCancellationRequested) 265if (connectTimeoutTokenSource.IsCancellationRequested) 478if (connectTimeoutTokenSource.IsCancellationRequested) 594if (connectTimeoutTokenSource.IsCancellationRequested) 691if (connectTimeoutTokenSource.IsCancellationRequested)
Microsoft.DotNet.Arcade.Sdk (1)
parent\Common\Tasks\ExecWithRetries.cs (1)
106if (i + 1 == MaxAttempts || _cancelTokenSource.IsCancellationRequested)
Microsoft.DotNet.Build.Tasks.Installers (1)
parent\Common\Tasks\ExecWithRetries.cs (1)
106if (i + 1 == MaxAttempts || _cancelTokenSource.IsCancellationRequested)
Microsoft.DotNet.Cli.InternalMicrosoft (2)
Internal\GitHubMembershipClient.cs (1)
74timeoutSource.IsCancellationRequested)
InternalMicrosoftDetector.cs (1)
248catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested && timeoutSource.IsCancellationRequested)
Microsoft.DotNet.HotReload.Watch (5)
HotReload\HotReloadDotNetWatcher.cs (2)
74_context.Logger.Log(source.IsCancellationRequested ? MessageDescriptor.RestartInProgress : MessageDescriptor.RestartRequested); 513else if (forceRestartCancellationSource.IsCancellationRequested)
HotReload\RunningProjectsManager.cs (1)
201catch (OperationCanceledException) when (processExitedSource.IsCancellationRequested)
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (1)
250if (_shutdownCancellationSource.IsCancellationRequested)
UI\ShutdownHandler.cs (1)
24var forceShutdown = _cancellationSource.IsCancellationRequested;
Microsoft.Extensions.Caching.Hybrid.Tests (1)
FactoryOptionsTests.cs (1)
46catch (OperationCanceledException) when (cts.IsCancellationRequested)
Microsoft.Extensions.Configuration (1)
ConfigurationReloadToken.cs (1)
28public bool HasChanged => _cts.IsCancellationRequested;
Microsoft.Extensions.Diagnostics.HealthChecks (1)
HealthCheckPublisherHostedService.cs (1)
58internal bool IsStopping => _stopping.IsCancellationRequested;
Microsoft.Extensions.FileProviders.Physical (4)
PhysicalFilesWatcher.cs (4)
823if (matchInfo.TokenSource.IsCancellationRequested) 1052if (_cts.IsCancellationRequested) 1061if (sender != _watcher || _cts.IsCancellationRequested) 1109if (sender != _watcher || _cts.IsCancellationRequested)
Microsoft.Extensions.Http.Diagnostics (1)
Logging\Internal\HttpResponseBodyReader.cs (1)
87catch (OperationCanceledException) when (joinedTokenSource.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
Microsoft.Extensions.Logging.AzureAppServices (1)
BatchingLoggerProvider.cs (1)
90while (!_cancellationTokenSource.IsCancellationRequested)
Microsoft.Extensions.ML (2)
ModelLoaders\UriModelLoader.cs (1)
68internal bool IsStopping => _stopping.IsCancellationRequested;
ModelReloadToken.cs (1)
31public bool HasChanged => _cts.IsCancellationRequested;
Microsoft.Extensions.Primitives (2)
CompositeChangeToken.cs (2)
119if (_cancellationTokenSource.IsCancellationRequested) 143if (compositeChangeTokenState._cancellationTokenSource.IsCancellationRequested)
Microsoft.Extensions.ServiceDiscovery (4)
ServiceEndpointWatcher.cs (4)
64ObjectDisposedException.ThrowIf(_disposalCancellation.IsCancellationRequested, this); 99if (!_disposalCancellation.IsCancellationRequested && _refreshTask.IsCompleted && (_cacheState == CacheStatus.Invalid || _cachedEndpoints is null or { ChangeToken.HasChanged: true } || force)) 165if (_disposalCancellation.IsCancellationRequested) 251if (_disposalCancellation.IsCancellationRequested)
Microsoft.Extensions.ServiceDiscovery.Dns (1)
Resolver\DnsResolver.cs (1)
490!pendingRequestsCts.IsCancellationRequested) // not cancelled by the global token (dispose)
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
220if (cts[0].IsCancellationRequested)
Microsoft.ML.AutoML (2)
AutoMLExperiment\IPerformanceMonitor.cs (2)
149_logger.Trace($"maximum memory usage: {_settings.MaximumMemoryUsageInMegaByte}, PeakMemoryUsage: {metrics.PeakMemoryUsage} trialIsCancelled: {trialCancellationTokenSource.IsCancellationRequested}"); 150if (_settings.MaximumMemoryUsageInMegaByte is double d && metrics.PeakMemoryUsage > d && !trialCancellationTokenSource.IsCancellationRequested)
Microsoft.ML.AutoML.Tests (2)
AutoMLExperimentTests.cs (2)
202Assert.True(cts.IsCancellationRequested); 233Assert.False(cts.IsCancellationRequested);
Microsoft.ML.Sweeper (2)
AsyncSweeper.cs (2)
242if (_cts.IsCancellationRequested) 278if (_cts.IsCancellationRequested)
Microsoft.NET.Build.Tasks (1)
GenerateBundle.cs (1)
155if (_cancellationTokenSource.IsCancellationRequested)
Microsoft.NET.Sdk.Publish.Tasks (1)
Tasks\ZipDeploy\ZipDeploymentStatus.cs (1)
44while (!tokenSource.IsCancellationRequested
Microsoft.TestPlatform.CrossPlatEngine (3)
Client\ProxyDiscoveryManager.cs (1)
167if (!(_proxyOperationManager != null && _proxyOperationManager.CancellationTokenSource.IsCancellationRequested && exception is CommunicationException))
Discovery\DiscoveryManager.cs (2)
155var isAborted = _cancellationTokenSource.IsCancellationRequested; 209if (!_cancellationTokenSource.IsCancellationRequested)
MSBuild (3)
XMake.cs (3)
1522if (s_buildCancellationSource.IsCancellationRequested) 2283if (s_buildCancellationSource.IsCancellationRequested) 2302if (s_buildCancellationSource.IsCancellationRequested)
MSBuild.Coordinator (4)
CoordinatorServer.cs (4)
193if (!_cts.IsCancellationRequested && IsIdle) 552if (_cts.IsCancellationRequested) 568if (_cts.IsCancellationRequested) 621if (!_cts.IsCancellationRequested && IsIdle)
NativeIntegrations.DockerCompose (1)
DockerCommand.cs (1)
67catch (OperationCanceledException) when (deadline.IsCancellationRequested)
NuGet.Build.Tasks (1)
StaticGraphRestoreTaskBase.cs (1)
211if (_cancellationTokenSource.IsCancellationRequested)
Roslyn.Diagnostics.Analyzers (19)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (7)
141if (_entireQueueCancellationTokenSource.IsCancellationRequested) 166if (_entireQueueCancellationTokenSource.IsCancellationRequested) 188if (_entireQueueCancellationTokenSource.IsCancellationRequested) 237if (_entireQueueCancellationTokenSource.IsCancellationRequested) 248if (_entireQueueCancellationTokenSource.IsCancellationRequested) 271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested); 293else if (batchResultTask.IsCanceled && !_entireQueueCancellationTokenSource.IsCancellationRequested)
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
50=> _cts is { IsCancellationRequested: false };
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
131while (!state.Cancellation.IsCancellationRequested) 138if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 296while (!state.Cancellation.IsCancellationRequested) 303if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 540Debug.Assert(!Cancellation.IsCancellationRequested);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
103if (_entireQueueCancellationTokenSource.IsCancellationRequested) 125if (_entireQueueCancellationTokenSource.IsCancellationRequested) 142if (_entireQueueCancellationTokenSource.IsCancellationRequested) 200if (_entireQueueCancellationTokenSource.IsCancellationRequested) 211if (_entireQueueCancellationTokenSource.IsCancellationRequested) 282if (_entireQueueCancellationTokenSource.IsCancellationRequested)
System.Collections.Concurrent (3)
System\Collections\Concurrent\BlockingCollection.cs (3)
991if (linkedTokenSource.IsCancellationRequested) 1390if (linkedTokenSource.IsCancellationRequested) 1395if (!linkedTokenSource.IsCancellationRequested) // if neither internal nor external cancellation requested
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\Validator.cs (2)
841catch (OperationCanceledException) when (linkedCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested) 983catch (OperationCanceledException) when (linkedCts.IsCancellationRequested && !cancellationToken.IsCancellationRequested)
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Metrics\AggregationManager.cs (1)
172Debug.Assert(_collectThread == null && !_cts.IsCancellationRequested);
System.IO.Pipelines (4)
System\IO\Pipelines\StreamPipeReader.cs (4)
292else if (tokenSource.IsCancellationRequested) 315if (tokenSource.IsCancellationRequested) 386if (tokenSource.IsCancellationRequested) 465bool isCancellationRequested = source.IsCancellationRequested;
System.Net.Http (5)
System\Net\Http\HttpClient.cs (3)
689else if (cts.IsCancellationRequested && !pendingRequestsCts.IsCancellationRequested) 703else if (e is HttpRequestException && cts.IsCancellationRequested) // if cancellationToken is canceled, cts will also be canceled
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
355Debug.Assert(_requestBodyCancellationSource.IsCancellationRequested);
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (1)
266_connectionDisposalCts.IsCancellationRequested)
System.Net.Quic (3)
System\Net\Quic\QuicListener.cs (1)
254catch (OperationCanceledException) when (_disposeCts.IsCancellationRequested)
System\Net\Quic\QuicStream.Stream.cs (2)
130catch (OperationCanceledException) when (cts?.IsCancellationRequested == true) 189catch (OperationCanceledException) when (cts?.IsCancellationRequested == true)
System.Private.CoreLib (11)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (1)
137if (m_dispatchTaskCancellationSource?.IsCancellationRequested ?? true)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationToken.cs (1)
65public bool IsCancellationRequested => _source != null && _source.IsCancellationRequested;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenRegistration.cs (2)
50if (source.IsCancellationRequested && // Running callbacks has commenced. 80if (source.IsCancellationRequested && // Running callbacks has commenced.
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (7)
113if (IsCancellationRequested) 327Debug.Assert(IsCancellationRequested); 426if (IsCancellationRequested) 593if (!IsCancellationRequested) 678if (!IsCancellationRequested || !registrations.Unregister(id, node)) 704if (!IsCancellationRequested && 731Debug.Assert(IsCancellationRequested, "ExecuteCallbackHandlers should only be called after setting IsCancellationRequested->true");
System.ServiceModel.Primitives.Tests (2)
Infrastructure\RetryOnFailureTests.cs (2)
248Assert.True(cancellation.IsCancellationRequested); 324if (cancellation.IsCancellationRequested)
System.Threading.Tasks.Dataflow (2)
Base\DataflowBlock.cs (2)
1273(_externalCancellationToken.IsCancellationRequested || _cts.IsCancellationRequested)) 2009if (cts.IsCancellationRequested)
System.Threading.Tasks.Parallel (7)
System\Threading\Tasks\Parallel.ForEachAsync.cs (7)
105while (!state.Cancellation.IsCancellationRequested) 129if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 269while (!state.Cancellation.IsCancellationRequested) 276if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 424while (!state.Cancellation.IsCancellationRequested) 431if (state.Cancellation.IsCancellationRequested || // check now that the lock has been acquired 653Debug.Assert(!Cancellation.IsCancellationRequested);