Skip to content

Conversation

@DylanRussell
Copy link
Contributor

@DylanRussell DylanRussell commented Nov 6, 2025

Description

Prevent recursive logging issues in SimpleLogRecordProcessor.on_emit by inspecting the stack trace to see how many times it's been called. Stop logging when we hit a recursive depth of 4.. This way we let through some logs through --- it may be the exporter has a transient log it is sending -- but stop when there's probably a recursive loop occurring.

I also reverted / cleaned up the changes I made in #4588. Looking at #4585 again -- the recursion issue is in the SimpleLogRecordProcessor not in the BatchLogRecordProcessor -- I think the batch processor should be safe from recursion because it is sending batches on a different thread periodically and not via a synchronous blocking call...

Type of change

Please delete options that are not relevant.

  • [x ] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Unit tests

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • [ x] No.

Checklist:

  • [ x] Followed the style guidelines of this project
  • [x ] Changelogs have been updated
  • [x ] Unit tests have been added
  • [ x] Documentation has been updated

@DylanRussell DylanRussell requested a review from a team as a code owner November 6, 2025 15:46
@DylanRussell DylanRussell changed the title Small change to prevent recursive logging issue in the simple log record processor Prevent recursive logging issue in the simple log record processor Nov 7, 2025
@DylanRussell DylanRussell changed the title Prevent recursive logging issue in the simple log record processor Prevent recursive logging issue in SimpleLogRecordProcessor.on_emit Nov 7, 2025
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.

1 participant