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

services: fix HealthService notifyWatchers #11934

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JoeCqupt
Copy link
Contributor

@JoeCqupt JoeCqupt commented Mar 3, 2025

fix #11853

Use ServerCallStreamObserver.setOnCancelHandler() to disable this exception

@JoeCqupt
Copy link
Contributor Author

JoeCqupt commented Mar 4, 2025

@zhangkun83 @carl-mastrangelo PTAL @kannanjgithub

@JoeCqupt JoeCqupt changed the title fix HealthService notifyWatchers services: fix HealthService notifyWatchers Mar 10, 2025
Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

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

I don't think we want to catch the exception. I think we want to avoid the exception by using setOnCancelHandler() as mentioned in the error to update watchers. That will release resources as soon as the RPC is cancelled.

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Mar 21, 2025
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Mar 21, 2025
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.

HealthStatusManager.setStatus can throw a runtime exception when notifying (already cancelled) watchers
3 participants