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

Gracefully handle errors from Future object callbacks. #20015

Merged
merged 4 commits into from Aug 20, 2019

Conversation

gnossen
Copy link
Contributor

@gnossen gnossen commented Aug 20, 2019

In #19910, it was pointed out that
raising an exception from a Future callback would cause the channel spin
thread to terminate. If there are outstanding events on the channel,
this will cause calls to Channel.close() to block indefinitely.

This commit ensures that the channel spin thread does not die. Instead,
exceptions will be logged at ERROR level.

This PR fixes #19910.

In grpc#19910, it was pointed out that
raising an exception from a Future callback would cause the channel spin
thread to terminate. If there are outstanding events on the channel,
this will cause calls to Channel.close() to block indefinitely.

This commit ensures that the channel spin thread does not die. Instead,
exceptions will be logged at ERROR level.
Copy link
Contributor

@lidizheng lidizheng left a comment

Choose a reason for hiding this comment

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

Good fix!

@gnossen
Copy link
Contributor Author

gnossen commented Aug 20, 2019

Known error: #20003

@gnossen gnossen merged commit 4a636ec into grpc:master Aug 20, 2019
@gnossen gnossen deleted the callback_exception_deadlock branch August 20, 2019 23:01
@lock lock bot locked as resolved and limited conversation to collaborators Nov 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/concurrency kind/bug lang/Python release notes: yes Indicates if PR needs to be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python channel close can deadlock when keepalive timeout happens
2 participants