-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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.Shutdown now applies the periodic reader's timeout by default #4356
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dashpole
requested review from
MrAlias,
Aneurysm9,
evantorrie,
XSAM,
MadVikingGod,
pellared,
hanyuancheung and
dmathieu
as code owners
July 24, 2023 17:22
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4356 +/- ##
=======================================
- Coverage 83.4% 83.4% -0.1%
=======================================
Files 184 184
Lines 14374 14376 +2
=======================================
- Hits 12001 11999 -2
- Misses 2145 2149 +4
Partials 228 228
|
dashpole
force-pushed
the
shutdown_timeout
branch
2 times, most recently
from
July 24, 2023 17:27
450de18
to
0412711
Compare
MrAlias
reviewed
Jul 24, 2023
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.
Can we update WithTimeout
documentation to include this behavior?
dashpole
force-pushed
the
shutdown_timeout
branch
from
July 24, 2023 17:49
0412711
to
8b328a3
Compare
Done |
MrAlias
approved these changes
Jul 24, 2023
dashpole
force-pushed
the
shutdown_timeout
branch
from
July 24, 2023 17:54
8b328a3
to
4b3b961
Compare
dashpole
force-pushed
the
shutdown_timeout
branch
from
July 24, 2023 18:30
bc0e07e
to
86881f9
Compare
Closed
2 tasks
pellared
reviewed
Jul 25, 2023
pellared
approved these changes
Jul 25, 2023
dmathieu
approved these changes
Jul 25, 2023
hanyuancheung
approved these changes
Jul 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#shutdown,
Shutdown SHOULD complete or abort within some timeout. Shutdown MAY be implemented as a blocking API or an asynchronous API which notifies the caller via a callback or an event. OpenTelemetry SDK authors MAY decide if they want to make the shutdown timeout configurable.
We don't currently have a timeout, so this PR adds a timeout to meet the specification.
We could hard-code the timeout, but I think it makes the most sense to re-use the timeout set with WithTimeout(), since Shutdown essentially is a collectAndExport call, which the shutdown is intended for. We can always add a separate timeout for Shutdown, as long as it defaults to the general timeout.
Fixes #3663
This is also relevant for #3666. For MetricExporter.Export:
Export MUST NOT block indefinitely, there MUST be a reasonable upper limit after which the call must time out with an error result (Failure).
That implies we should set a timeout on contexts we pass to Export, which this PR does.