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
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#4364](https://github.com/open-telemetry/opentelemetry-python/pull/4364))
- Add Python 3.13 support
([#4353](https://github.com/open-telemetry/opentelemetry-python/pull/4353))
- Disconnect gRPC client stub when shutting down `OTLPSpanExporter`
([#4370](https://github.com/open-telemetry/opentelemetry-python/pull/4370))

## Version 1.29.0/0.50b0 (2024-12-11)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

self._export_lock.release()

@property
Expand Down