Skip to content

Fix max recursion bug by removing logging.log calls in emit #4586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 0 commits into from

Conversation

DylanRussell
Copy link
Contributor

@DylanRussell DylanRussell commented May 15, 2025

Description

Remove logging.log calls from BatchProcessor.emit. Any log calls in that function can get routed back to emit and ultimately result in a maximum recursion depth exceeded exception.

Fixes: 4585

How Has This Been Tested?

Added a unit test to prevent this.

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

Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

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

Test is failing at main. LGTM with a changelog.

@DylanRussell
Copy link
Contributor Author

Added a changelog entry

Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi left a comment

Choose a reason for hiding this comment

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

Thank you for this 🙂

Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

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

I think you can make the test much simpler to just test a minimal repro of the reported issue

@DylanRussell
Copy link
Contributor Author

Ok updated test to attach handler to SDK logger instead of root, and remove it after test is done.

@aabmass aabmass linked an issue May 15, 2025 that may be closed by this pull request
Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

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

@aabmass, just a reminder that the current main branch is different from release/v1.33.x-0.54bx branch in terms of the structure of directories for the SDK. In the release branch there's no _shared_internal directory because this change was merged this week. So, probably would be better that in the backport PR we just remove the log line or maybe would be worth @DylanRussell open the PR against the release branch instead of main.

@DylanRussell
Copy link
Contributor Author

Moved this to #4588 .. Had this code in my main branch by mistake.. moved it to another branch, but couldn't edit this PR to move to that branch. So just opened up a new PR

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.

Infinit recursion in log shutdown code
4 participants