wenbingshen commented on a change in pull request #14602:
URL: https://github.com/apache/pulsar/pull/14602#discussion_r822252535
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
##########
@@ -1975,8 +1981,17 @@ private void
failPendingBatchMessages(PulsarClientException ex) {
if (isBatchMessagingEnabled()) {
batchMessageAndSend();
}
- lastSendFuture = this.lastSendFuture;
+ if (lastSendFutureResponse) {
+ lastSendFuture = this.lastSendFutureEmpty;
+ } else {
+ lastSendFuture = this.lastSendFuture;
+ lastSendFuture.exceptionally(ignored -> {
+ lastSendFutureResponse = true;
+ return null;
+ });
+ }
}
+
return lastSendFuture.thenApply(ignored -> null);
Review comment:
Thanks for your review. I added a `LastSendFutureWrapper` to wrap
`lastSendFuture`. Is this implementation correct? Can you help take a look?
Thanks.
--
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]