Interrupt exporter retry backoff sleeps when shutdown is called. Update BatchSpan/LogRecordProcessor.shutdown to complete in 30 seconds#4638
Merged
xrmx merged 51 commits intoopen-telemetry:mainfrom Jul 23, 2025
Conversation
Contributor
Author
|
Ok. Removed 4623 from the list of fixed |
aabmass
reviewed
Jun 24, 2025
...xporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/_log_exporter/__init__.py
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_shared_internal/__init__.py
Outdated
Show resolved
Hide resolved
aabmass
reviewed
Jul 14, 2025
Member
aabmass
left a comment
There was a problem hiding this comment.
I'm not 100% sure on the Exporter.shutdown comment, I'll think on it a little
opentelemetry-sdk/src/opentelemetry/sdk/_shared_internal/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_shared_internal/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_shared_internal/__init__.py
Outdated
Show resolved
Hide resolved
aabmass
approved these changes
Jul 17, 2025
opentelemetry-sdk/src/opentelemetry/sdk/_shared_internal/__init__.py
Outdated
Show resolved
Hide resolved
emdneto
reviewed
Jul 18, 2025
emdneto
reviewed
Jul 18, 2025
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
…etry-python into shutdown_refactor
emdneto
approved these changes
Jul 18, 2025
Member
emdneto
left a comment
There was a problem hiding this comment.
discussed offline to rename the shutdown event variable to _shutdown_in_progress.
Member
@DylanRussell is this done? Please update branch I can merge |
Contributor
Author
|
Yes it's done. I renamed the variable. I've merged main now, should be good to go |
xrmx
approved these changes
Jul 23, 2025
JWinermaSplunk
pushed a commit
to JWinermaSplunk/opentelemetry-python
that referenced
this pull request
Feb 17, 2026
…te BatchSpan/LogRecordProcessor.shutdown to complete in 30 seconds (open-telemetry#4638) * Initial commit to add timeout as a parm to export, make retries encompass timeout * Fix lint issues * Fix a bunch of failing style/lint/spellcheck checks * Remove timeout param from the export calls. * Fix flaky windows test ? * Respond to review comments.. * Delete exponential backoff code that is now unused * Add changelog and remove some unused imports.. * fix typo and unit test flaking on windows * Refactor tests, HTTP exporters a bit * Remove unneeded test reqs * Remove gRPC retry config * Tweak backoff calculation * Lint and precommit * Empty commit * Another empty commit * Calculate backoff in 1 place instead of 2 * Update changelog * Update changelog * Make new _common directory in the http exporter for shared code * precommit * Make many changes * Reorder shutdown stuff * Fix merging * Don't join the thread in case we are stuck in an individual export call * Add tests, changelog entry * Update time assertions to satisfy windows.. Fix lint issues * Skip test on windows * Use threading Event instead of sleep loop. * Respond to review comments.. * Pass remaining timeout to shutdown * Run precommit * Change variable names * Switch timeout back to timeout_millis * Update CHANGELOG.md Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> * Update CHANGELOG.md Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> * Rename variable * Fix variable name --------- Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
JWinermaSplunk
pushed a commit
to JWinermaSplunk/opentelemetry-python
that referenced
this pull request
Feb 17, 2026
…te BatchSpan/LogRecordProcessor.shutdown to complete in 30 seconds (open-telemetry#4638) * Initial commit to add timeout as a parm to export, make retries encompass timeout * Fix lint issues * Fix a bunch of failing style/lint/spellcheck checks * Remove timeout param from the export calls. * Fix flaky windows test ? * Respond to review comments.. * Delete exponential backoff code that is now unused * Add changelog and remove some unused imports.. * fix typo and unit test flaking on windows * Refactor tests, HTTP exporters a bit * Remove unneeded test reqs * Remove gRPC retry config * Tweak backoff calculation * Lint and precommit * Empty commit * Another empty commit * Calculate backoff in 1 place instead of 2 * Update changelog * Update changelog * Make new _common directory in the http exporter for shared code * precommit * Make many changes * Reorder shutdown stuff * Fix merging * Don't join the thread in case we are stuck in an individual export call * Add tests, changelog entry * Update time assertions to satisfy windows.. Fix lint issues * Skip test on windows * Use threading Event instead of sleep loop. * Respond to review comments.. * Pass remaining timeout to shutdown * Run precommit * Change variable names * Switch timeout back to timeout_millis * Update CHANGELOG.md Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> * Update CHANGELOG.md Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> * Rename variable * Fix variable name --------- Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
This file contains hidden or 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
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.
Description
This PR updates the HTTP/gRPC OTLP Exporters, so that the retry backoff sleep in
exportgets immediately interrupted (and failure returned) whenshutdownis called, instead of sleeping / retrying to completion.This PR also updates the BatchSpan/LogRecordProcessor's
shutdownmethod to complete after 30 seconds instead of continuing to run until all telemetry was flushed from the queue.Fixes an issue where shutdown would hang or stall indefinitely, especially when export was failing inside a retry loop.
Fixes: #3309, #4043, #2663
Type of change
How Has This Been Tested?
Does This PR Require a Contrib Repo Change?
Checklist: