You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/03/09 03:14:06 UTC

[GitHub] [pulsar] wenbingshen commented on a change in pull request #14602: Fix PartitionedProducerImpl flushAsync always fail when one partition send TimeOutException

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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org