Repository navigation
Propagate cancellation tokens through data store persistence - #5744
Merged
Merged
Conversation
rbev
approved these changes
Aug 12, 2026
| } | ||
| #pragma warning disable PS0019 // The filter already excludes OperationCanceledException, so | ||
| // cancellation propagates; PS0019 only recognises a cancellationToken guard. | ||
| catch (Exception ex) when (ex is not OperationCanceledException) |
Contributor
There was a problem hiding this comment.
Could you avoid the pragma by doing
Suggested change
| catch (Exception ex) when (ex is not OperationCanceledException) | |
| catch (Exception ex) when (ex is not OperationCanceledException && cancellationToken.IsCancellationRequested) |
Also it probably wants to log cancellation exceptions that are not related to the current token
Member
Author
There was a problem hiding this comment.
Our analyser seems to be very picky and always wants catch (OperationCanceledException ex) when (cancellationToken.IsCancellationRequested).
So any deviation from that causes a warning.
johnsimons
force-pushed
the
john/cancel_part12
branch
from
August 12, 2026 02:53
ffaac33 to
6309e2e
Compare
johnsimons
force-pushed
the
john/cancel_part12
branch
from
August 12, 2026 03:30
6309e2e to
a999a14
Compare
This change continues the effort to consistently apply optional `CancellationToken` parameters to asynchronous methods within the `IMonitoringDataStore` interface, its EFCore and RavenDB implementations, and the controllers, handlers, and services that consume them. Cancellation tokens are now propagated to underlying asynchronous database calls, ensuring proper cancellation of long-running operations and further reducing cancellation analyzer debt.
…s and trial license persistence This change continues the effort to consistently apply optional `CancellationToken` parameters to asynchronous methods within the `IEndpointSettingsStore`, `IServiceControlSubscriptionStorage`, and `ITrialLicenseDataProvider` interfaces, along with their EFCore and RavenDB implementations. Cancellation tokens are now propagated to underlying asynchronous database calls, ensuring proper cancellation of long-running operations and further reducing cancellation analyzer debt.
…es and lifecycle operations This change continues the effort to consistently apply optional `CancellationToken` parameters to asynchronous methods across the remaining persistence interfaces and lifecycle operations, along with their EFCore and RavenDB implementations. Cancellation tokens are now propagated to underlying asynchronous database calls and lifecycle hooks, ensuring proper responsiveness to cancellation. This work retires the majority of cancellation analyzer suppressions across the persistence projects, leaving only the licensing data store—which belongs to the licensing phase—as an accepted exception.
This change continues the effort to consistently apply optional `CancellationToken` parameters to asynchronous methods within the `ILicensingDataStore` interface, along with its In-Memory, EFCore, and RavenDB implementations. Cancellation tokens are now propagated to underlying asynchronous database calls, ensuring proper responsiveness to cancellation and retiring the remaining cancellation analyzer debt for these projects.
…s check This change removes a redundant comment explaining the PS0020 analyzer suppression within the RavenDB licensing status check, continuing the effort to clean up cancellation-related debt.
johnsimons
force-pushed
the
john/cancel_part12
branch
from
August 12, 2026 03:41
a999a14 to
399ff72
Compare
… persistence This change continues the effort to consistently apply optional `CancellationToken` parameters to asynchronous methods within the `IFailedMessageRetryDataStore` EFCore implementation. Cancellation tokens are now propagated to underlying asynchronous database calls, ensuring proper responsiveness to cancellation and further reducing cancellation analyzer debt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Propagate cancellation tokens through licensing data store persistence.
Propagate cancellation tokens through remaining persistence data stores and lifecycle operations
Propagate cancellation tokens through endpoint settings, subscriptions and trial license persistence