Skip to content

Conversation

aomader
Copy link
Contributor

@aomader aomader commented May 12, 2025

As already mentioned in the doc-string of the CanConnectAsync method, it should throw an OperationCanceledException in case the CancellationToken fired and the check method threw a corresponding exception.

This PR addresses this shortcoming and goes hand-in-hand with this change to ASP.NET Core's DbContextHealthCheck to propagate OperationCanceledExceptions.

@aomader aomader requested a review from a team as a code owner May 12, 2025 14:20
@aomader
Copy link
Contributor Author

aomader commented May 12, 2025

@dotnet-policy-service agree

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that we shouldn't return false for OperationCanceledException, but see comment below.

@roji roji self-assigned this May 13, 2025
@roji roji enabled auto-merge (squash) May 14, 2025 07:53
@roji roji merged commit 7950192 into dotnet:main May 14, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants