Repository navigation
Isolate nonfatal failures in LogRecordProcessor.onEmit - #9067
ultramancode wants to merge 2 commits into
Conversation
Signed-off-by: Taewoong Kim <ktw2172@gmail.com>
Pull request dashboard statusWaiting 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):
Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Signed-off-by: Taewoong Kim <ktw2172@gmail.com>
jack-berg
left a comment
There was a problem hiding this comment.
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
|
Thank you for the detailed explanation! That makes sense. I'll update the PR to use GuardedLogger once #9087 is merged. |
Fixes #9066
Log nonfatal failures from
LogRecordProcessor.onEmitso 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
ThrottlingLoggerto limit repeated warnings. The OTLP HTTP and gRPC exporters already use it too, so I think it makes sense to move it to animplpackage alongsideThrowableUtilin the follow-up to #9022.