Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Complete health checks watch service on server shutting down #2582

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Dec 9, 2024

Fixes the same issue as #2573: health checks Watch call completes when the server begins shutting down. This avoids the problem of a shutting down server waiting for the health check call to be complete (default is 30 seconds) before forcefully killing the request.

Differences:

  • Avoids duplicating the health checks service implementaiton. Cancellation is now passed in via ServerCallContext
  • Adds option to enable and disable this behavior. Completing on shutdown is enabled by default with the option to suppress it and go back to old behavior.
  • Adds tests

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 6 changed files in this pull request and generated no suggestions.

Files not reviewed (1)
  • src/Grpc.AspNetCore.HealthChecks/GrpcHealthChecksOptions.cs: Evaluated as low risk
Comments skipped due to low confidence (2)

src/Grpc.HealthCheck/HealthServiceImpl.cs:144

  • The word 'implementaiton' in the pull request description is misspelled. It should be 'implementation'.
// The call has already been canceled. Writing to the response will fail so immediately exit.

src/Grpc.AspNetCore.HealthChecks/GrpcHealthChecksPublisher.cs:18

  • The word 'implementaiton' is misspelled. It should be 'implementation'.
Avoids duplicating the health checks service implementaiton. Cancellation is now passed in via ServerCallContext
@JamesNK JamesNK merged commit c9d2671 into grpc:master Dec 12, 2024
5 checks passed
@JamesNK JamesNK deleted the jamesnk/healthchecks-end-call branch December 12, 2024 02:17
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