Skip to content

Isolate nonfatal failures in span processor callbacks - #9022

Open
ultramancode wants to merge 2 commits into
open-telemetry:mainfrom
ultramancode:fix/span-onending-exception
Open

ultramancode wants to merge 2 commits into
open-telemetry:mainfrom
ultramancode:fix/span-onending-exception

Conversation

@ultramancode

@ultramancode ultramancode commented Nov 8, 2026 •

Copy link
Copy Markdown

Fixes #9021

Log nonfatal failures from onStart, onEnding, and onEnd so they don't propagate to application code. A nonfatal failure in one processor no longer prevents the remaining processors from receiving the same callback.

Fatal errors are still rethrown. If onEnding throws a fatal error, the SDK marks the span as ended and clears the ending thread reference before the error reaches the caller.

Added tests for both nonfatal and fatal failures, including a case where the first processor throws a nonfatal exception and the second still receives the callback.

Signed-off-by: Taewoong Kim <ktw2172@gmail.com>
@ultramancode
ultramancode requested a review from a team as a code owner November 8, 2026 15:46
@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: ultramancode / name: Taewoong Kim (17d85e1)

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-11-26 11:19 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with the author? Comment /dashboard route:author to route it back.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.57%. Comparing base (f02bddc) to head (6efb6cc).
⚠️ Report is 28 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9022      +/-   ##
============================================
+ Coverage     90.35%   90.57%   +0.21%     
- Complexity    11017    11225     +208     
============================================
  Files          1021     1033      +12     
  Lines         30128    30618     +490     
  Branches       3933     4010      +77     
============================================
+ Hits          27221    27731     +510     
+ Misses         1953     1913      -40     
- Partials        954      974      +20     

☔ View full report in Codecov by Harness.
📢 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.

@ultramancode

Copy link
Copy Markdown
Author

@jack-berg
Thanks for the review! I’ll update this PR as suggested.
I’ll also take on both follow-ups and open a separate issue and PR for each.

Signed-off-by: Taewoong Kim <ktw2172@gmail.com>
@ultramancode ultramancode changed the title End span even if ExtendedSpanProcessor.onEnding throws Isolate nonfatal failures in span processor callbacks Nov 26, 2026
@ultramancode

Copy link
Copy Markdown
Author

@jack-berg

I opened #9067 for the log side and used ThrottlingLogger there to limit repeated warnings. It’s internal to sdk:common, and the OTLP exporters already use it too, so I’d like to move it to an impl package alongside ThrowableUtil in the follow-up.

This branch has not been deployed

No deployments
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.

Exception from ExtendedSpanProcessor.onEnding escapes Span.end() and drops the span

2 participants