Skip to content

Conversation

@gerolf-da
Copy link
Contributor

SdkSpan never releases the reference to the Thread object in spanEndingThread. This means, that the thread (and all the objects referenced by it) cannot be garbage collected if the ended SdkSpan is held in memory for an extended period of time (for whatever reason).

Since spanEndingThread is only needed in the ENDING phase, it can be set back to null once the ENDED phase has been reached.

SdkSpan never releases the reference to the Thread in spanEndingThread.
This means that the thread (and all the objects referenced by it) cannot
be garbage collected, if the SdkSpan is held in memory for an extended
period of time.

Since spanEndingThread is only needed in the ENDING phase, it can be set
back to null once the ENDED phase has been reached.
@gerolf-da gerolf-da requested a review from a team as a code owner January 16, 2026 10:51
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 16, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: gerolf-da / name: Gerolf Seitz (6cc87b9)
  • ✅ login: jack-berg / name: Jack Berg (92a2367)

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.16%. Comparing base (1b5cb49) to head (92a2367).
⚠️ Report is 53 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7984      +/-   ##
============================================
+ Coverage     90.12%   90.16%   +0.03%     
- Complexity     7318     7478     +160     
============================================
  Files           824      836      +12     
  Lines         22027    22551     +524     
  Branches       2177     2224      +47     
============================================
+ Hits          19852    20333     +481     
- Misses         1498     1516      +18     
- Partials        677      702      +25     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is reasonable enough, though its a bit odd to think about SdkSpan references being held after SpanProcessor threads have stopped.

@jack-berg jack-berg merged commit 18f8a13 into open-telemetry:main Jan 20, 2026
27 checks passed
@otelbot
Copy link
Contributor

otelbot bot commented Jan 20, 2026

Thank you for your contribution @gerolf-da! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

@gerolf-da
Copy link
Contributor Author

Thanks for merging and adding an additional test case.

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