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

client: ensure channels are closed on __del__() #4

Closed
wants to merge 1 commit into from

Conversation

jecluis
Copy link
Contributor

@jecluis jecluis commented Apr 7, 2021

We have found that bad things can happen if 'close()' is not explicitly
called, especially with grpclib raising exceptions due to open channels.

By relying on __del__(), we ensure that we cleanup after ourselves.

Signed-off-by: Joao Eduardo Luis <joao@suse.com>

We have found that bad things can happen if 'close()' is not explicitly
called, especially with grpclib raising exceptions due to open channels.

By relying on __del__(), we ensure that we cleanup after ourselves.

Signed-off-by: Joao Eduardo Luis <joao@suse.com>
@jecluis
Copy link
Contributor Author

jecluis commented Apr 10, 2021

Turns out, there is a corner case when this ends up throwing a RuntimeError due to the event loop being already running. We managed to curb the whole thing without the patch, by doing some additional foo that allows us to close the client explicitly. :)

@jecluis jecluis closed this Apr 10, 2021
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.

None yet

1 participant