Skip to content

fix(DbContextHealthCheck): propagate OperationCanceledExceptions instead of reporting unhealthy #61883

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aomader
Copy link

@aomader aomader commented May 12, 2025

This change ensures that OperationCanceledExceptions bubble up the DbContextHealthCheck (in case the cancellationToken requested a cancellation) so that they are not incorrectly treated as unhealthy checks, but can instead for example get correctly swallowed by the callers.

This goes hand-in-hand with this change to EF Core that ensures that the default health check correctly throws an exception in case of a cancellationToken-related exception.

@aomader aomader requested a review from BrennanConroy as a code owner May 12, 2025 13:55
@github-actions github-actions bot added the area-healthchecks Includes: Healthchecks (some bugs also in Extensions repo) label May 12, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label May 12, 2025
Copy link
Contributor

Thanks for your PR, @@aomader. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-healthchecks Includes: Healthchecks (some bugs also in Extensions repo) community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant