Skip to content
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

[fix][client] Fix memory leak when message size exceeds max message size and batching is enabled #23967

Merged

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Feb 12, 2025

Motivation

When enabling Netty leak detection with #23956 changes at paranoid level, BatchMessageTest.testSendOverSizeMessage shows a Netty ByteBuf memory leak. This is a bug in BatchMessageContainerImpl. It doesn't release the payload when the message size exceeds max message size.

Modifications

  • Properly release the payload (or compressed payload) buffer when the message size exceeds max message size

Additional context

After #23956 changes are included, it is possible to catch such memory leaks in pull request CI builds.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.23%. Comparing base (bbc6224) to head (9573768).
Report is 906 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23967      +/-   ##
============================================
+ Coverage     73.57%   74.23%   +0.65%     
+ Complexity    32624    32260     -364     
============================================
  Files          1877     1853      -24     
  Lines        139502   143822    +4320     
  Branches      15299    16337    +1038     
============================================
+ Hits         102638   106762    +4124     
+ Misses        28908    28669     -239     
- Partials       7956     8391     +435     
Flag Coverage Δ
inttests 26.72% <0.00%> (+2.13%) ⬆️
systests 23.22% <0.00%> (-1.10%) ⬇️
unittests 73.74% <100.00%> (+0.90%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../pulsar/client/impl/BatchMessageContainerImpl.java 85.95% <100.00%> (+5.05%) ⬆️

... and 1040 files with indirect coverage changes

@merlimat merlimat merged commit 3581127 into apache:master Feb 12, 2025
74 of 78 checks passed
merlimat pushed a commit that referenced this pull request Feb 12, 2025
merlimat pushed a commit that referenced this pull request Feb 12, 2025
merlimat pushed a commit that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants