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

Disconnect gRPC client stub when shutting down OTLPSpanExporter #4370

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

xmakro
Copy link

@xmakro xmakro commented Dec 21, 2024

Otherwise the gRPC client will stay connected past the shutdown

@xmakro xmakro requested a review from a team as a code owner December 21, 2024 17:46
Copy link

linux-foundation-easycla bot commented Dec 21, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@xrmx
Copy link
Contributor

xrmx commented Dec 23, 2024

@xmakro Thanks for the PR, please add a CHANGELOG entry. Can this be tested?

@xmakro
Copy link
Author

xmakro commented Dec 23, 2024

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
Copy link
Contributor

@xrmx xrmx Dec 24, 2024

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

Copy link
Author

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

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