-
Notifications
You must be signed in to change notification settings - Fork 652
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
Disconnect gRPC client stub when shutting down OTLPSpanExporter #4370
base: main
Are you sure you want to change the base?
Conversation
@xmakro Thanks for the PR, please add a CHANGELOG entry. Can this be tested? |
I added the change log. I don't see a good way to test the disconnect, since it is the gRPC channel that gets disconnected, but these channels are not exposed on the gRPC server side api. |
@@ -360,6 +360,7 @@ def shutdown(self, timeout_millis: float = 30_000, **kwargs) -> None: | |||
# wait for the last export if any | |||
self._export_lock.acquire(timeout=timeout_millis / 1e3) | |||
self._shutdown = True | |||
self._client = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if storing the channel in __init__
and call here its close() method would work too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good idea that is cleaner. I verified that this works as well and changed the PR
Otherwise the gRPC client will stay connected past the shutdown