poorbarcode opened a new pull request, #19585:
URL: https://github.com/apache/pulsar/pull/19585

   ### Motivation
   
   #### 1. Memory leak if enabled pooled messages
   If enabled pooled messages of a consumer, the the passed payload of messages 
will use the `ByteBuf` which is coming from network and is backed by a direct 
buffer, it will not release the buffers in the incoming queue when consumer is 
closing.
   
   #### 2. flaky test 
`BrokerClientIntegrationTest.testPooledMessageWithAckTimeout`
   see: https://github.com/apache/pulsar/actions/runs/4231062918/jobs/7349401610
   
   Cause: If enabled pooled messages, the ByteBuf named `payload` in 
`MessageImpl` will be reused if released. So the expression `payload.refCnt()` 
will not be `0` if it it used by another place.
   
   ### Modifications
   - release the messages in the incoming queue when consumer is closing
   - fix flaky test BrokerClientIntegrationTest.testPooledMessageWithAckTimeout
   
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update 
later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository:
   - https://github.com/poorbarcode/pulsar/pull/72
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to