Skip to content

Conversation

@fidelisojeah
Copy link
Contributor

Summary

Changes

Please provide a summary of what's being changed

This PR fixes a bug where an infinite loop occurs when a new buffered log's byte size is equal to the maxBytes size (logBufferOptions.maxBytes) specified while log buffering is enabled (logBufferOptions.enabled = true).

See issue for more details.

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: closes #4737


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@pull-request-size pull-request-size bot added the size/M PR between 30-99 LOC label Nov 13, 2025
@boring-cyborg boring-cyborg bot added logger This item relates to the Logger Utility tests PRs that add or change tests labels Nov 13, 2025
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 13, 2025

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #typescript channel on our Powertools for AWS Lambda Discord: Invite link

@dreamorosi
Copy link
Contributor

Thank you for the PR, we'll review it soon.

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

Set @svozza as reviewer

@fidelisojeah fidelisojeah force-pushed the fojeah/fix-logger-buffer-infinite-loop branch from facf526 to 83e904d Compare November 13, 2025 13:09
@fidelisojeah fidelisojeah changed the title chore(logger): infinite loop on log buffer when item size is max bytes fix(logger): infinite loop on log buffer when item size is max bytes Nov 13, 2025
@svozza
Copy link
Contributor

svozza commented Nov 13, 2025

Nice work @fidelisojeah! I only had two very minor comments.

@fidelisojeah fidelisojeah force-pushed the fojeah/fix-logger-buffer-infinite-loop branch from 83e904d to 2c5e55b Compare November 13, 2025 14:14
@sonarqubecloud
Copy link

@fidelisojeah fidelisojeah requested a review from svozza November 13, 2025 14:16
@svozza
Copy link
Contributor

svozza commented Nov 13, 2025

Great stuff @fidelisojeah , merging now!

@svozza svozza merged commit f0677d4 into aws-powertools:main Nov 13, 2025
34 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 13, 2025

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

@fidelisojeah fidelisojeah deleted the fojeah/fix-logger-buffer-infinite-loop branch November 13, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logger This item relates to the Logger Utility size/M PR between 30-99 LOC tests PRs that add or change tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Log buffer would run an infinite loop when the size of the log is exactly the same as the maxBytes size specified.

3 participants