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

PeriodicReader - alternate shutdown implementation #2482

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cijothomas
Copy link
Member

An alternate way of handling shutdown - this just sends a message to the background thread to initiate shutdown, and wait for thread handle to join.
The handle.join() has some risks - as shutdown could get block indefinitely if the background thread is stuck in a export, and we cannot enforce timeout :(

An alternative way would be keep the existing way, but enforce recv_timeout, so that shutdown always ends in a fixed time, no matter whether background is stuck or not. Will send a PR with this approach as well, but either way, if a rogue exporter is used, background thread is still stuck. All we can ensure is shutdown gets a timed exit. (esp. important since shutdown can be triggered automatically when Drop() occurs...)

Not for merge, but to have a discussion about various approaches.

@cijothomas cijothomas requested a review from a team as a code owner December 27, 2024 21:44
Copy link

codecov bot commented Dec 27, 2024

Codecov Report

Attention: Patch coverage is 60.71429% with 11 lines in your changes missing coverage. Please review.

Project coverage is 77.8%. Comparing base (8fde6eb) to head (7e6f2e4).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-sdk/src/metrics/periodic_reader.rs 60.7% 11 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2482     +/-   ##
=======================================
+ Coverage   77.2%   77.8%   +0.5%     
=======================================
  Files        124     123      -1     
  Lines      23043   22875    -168     
=======================================
+ Hits       17800   17805      +5     
+ Misses      5243    5070    -173     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant