aahmed-se commented on a change in pull request #12181:
URL: https://github.com/apache/pulsar/pull/12181#discussion_r718808933
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
##########
@@ -1790,9 +1796,15 @@ private void batchMessageAndSend() {
}
} catch (PulsarClientException e) {
Thread.currentThread().interrupt();
- semaphore.ifPresent(s ->
s.release(batchMessageContainer.getNumMessagesInBatch()));
+ semaphore.ifPresent(s -> s.release(Math.min(
+ maxPermits - s.availablePermits(),
+ batchMessageContainer.getNumMessagesInBatch()))
Review comment:
This limits this issue https://github.com/apache/pulsar/issues/12151
happening in prod. Since we implementing a max limit.
--
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]