BewareMyPower opened a new pull request #13454:
URL: https://github.com/apache/pulsar/pull/13454


   ### Motivation
   
   When a large message is sent by chunks, each chunk needs to reserve a spot 
of the semaphore. However, when it failed, the already reserved memory from 
limiter and spots from semaphore are not released.
   
   ### Modifications
   
   - Release the semaphore and memory when `canEnqueueRequest` returns false 
for chunks.
   - Add `testChunksEnqueueFailed` to cover this case. It sends a large message 
whose number of chunks is greater than the `maxPendingMessages` so that the 
first time `canEnqueueRequest` returns true while the following 
`canEnqueueRequest` calls will return false.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change added tests `testChunksEnqueueFailed`.


-- 
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