Skip to content

Isolate nonfatal failures in LogRecordProcessor.onEmit - #9067

Open
ultramancode wants to merge 2 commits into
open-telemetry:mainfrom
ultramancode:fix/isolate-log-processor-failures
Open

ultramancode wants to merge 2 commits into
open-telemetry:mainfrom
ultramancode:fix/isolate-log-processor-failures

Conversation

@ultramancode

Copy link
Copy Markdown
Contributor

Fixes #9066

Log nonfatal failures from LogRecordProcessor.onEmit so they don't propagate to application code. If one processor throws a nonfatal exception, the remaining processors still receive the same log record. Fatal errors are still rethrown.

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 record.

I used ThrottlingLogger to limit repeated warnings. The OTLP HTTP and gRPC exporters already use it too, so I think it makes sense to move it to an impl package alongside ThrowableUtil in the follow-up to #9022.

Signed-off-by: Taewoong Kim <ktw2172@gmail.com>
@ultramancode
ultramancode requested a review from a team as a code owner November 26, 2026 11:10
@opentelemetry-pr-dashboard

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

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-12-01 16:38 UTC

Respond to 1 review item (e.g. link a commit, explain why not, ask a follow-up):

  • Top-level threads: 1
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 reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.52%. Comparing base (a92b644) to head (84b40d7).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9067      +/-   ##
============================================
- Coverage     90.56%   90.52%   -0.04%     
- Complexity    11220    11245      +25     
============================================
  Files          1032     1040       +8     
  Lines         30599    30687      +88     
  Branches       4010     4015       +5     
============================================
+ Hits          27711    27780      +69     
- Misses         1913     1928      +15     
- Partials        975      979       +4     

☔ 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.

Signed-off-by: Taewoong Kim <ktw2172@gmail.com>

@jack-berg jack-berg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code for this looks pretty good. However, there's a problem. Logs is different from spans in that the primary use case for log API is to bridge logs recorded through other APIs. The diagnostic logs we emit via JUL are subject to be bridged back to the log API, causing a stackoverflow if the caller doesn't have mechanisms to prevent it.

I opened #9087 to add a dedicated Logger wrapper we can use in the log sdk to guard against this, along with guidance to use this wrapper for diagnostic logging in the log SDK. Let's wait for that to merge, then update this PR to use GuardedLogger

@ultramancode

Copy link
Copy Markdown
Contributor Author

Thank you for the detailed explanation! That makes sense. I'll update the PR to use GuardedLogger once #9087 is merged.

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.

LogRecordBuilder.emit() propagates processor exceptions and skips later processors

2 participants