Nicklee007 commented on code in PR #16837:
URL: https://github.com/apache/pulsar/pull/16837#discussion_r932820240
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ProducerMemoryLimitTest.java:
##########
@@ -69,6 +69,35 @@ public void testProducerTimeoutMemoryRelease() throws
Exception {
}
+ @Test(timeOut = 10_000)
+ public void testProducerBatchSendTimeoutMemoryRelease() throws Exception {
+ initClientWithMemoryLimit();
+ @Cleanup
+ ProducerImpl<byte[]> producer = (ProducerImpl<byte[]>)
pulsarClient.newProducer()
+ .topic("testProducerMemoryLimit")
+ .sendTimeout(5, TimeUnit.SECONDS)
+ .maxPendingMessages(0)
+ .enableBatching(true)
+ .batchingMaxPublishDelay(100, TimeUnit.MILLISECONDS)
+ .batchingMaxBytes(12)
+ .create();
+ this.stopBroker();
+ try {
+
producer.newMessage().value("memory-test".getBytes(StandardCharsets.UTF_8)).sendAsync();
+ try {
+
producer.newMessage().value("memory-test".getBytes(StandardCharsets.UTF_8)).sendAsync().get();
Review Comment:
@Jason918 Through some test, find the memory limit release operator add in
`batchMessageAndSend` will cause duplicate release with add in
`failPendingBatchMessages`. So remove the fixed in `batchMessageAndSend`.
Please take another look, Thks.
--
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]