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 2020/12/18 20:24:30 UTC

[GitHub] [pulsar] merlimat commented on a change in pull request #8992: PIP-68: WaitForExclusive producer access mode

merlimat commented on a change in pull request #8992:
URL: https://github.com/apache/pulsar/pull/8992#discussion_r546073335



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
##########
@@ -468,6 +469,19 @@ protected void handleProducerSuccess(CommandProducerSuccess success) {
                     success.getRequestId(), success.getProducerName());
         }
         long requestId = success.getRequestId();
+        if (!success.getProducerReady()) {
+            // We got a success operation but the producer is not ready. This means that the producer has been queued up
+            // in broker. We need to leave the future pending until we get the final confirmation. We just mark that
+            // we have received a response, in order to avoid the timeout.
+            TimedCompletableFuture<?> requestFuture = (TimedCompletableFuture<?>) pendingRequests.get(requestId);
+            if (requestFuture != null) {
+                log.info("{} Producer {} has been queued up at broker. request: {}", ctx.channel(),
+                        success.getProducerName(), requestId);
+                requestFuture.markAsResponded();

Review comment:
       Yes, the marking of the future is only for timeout within a single connection. When a connection fails, everything that was in that connections is marked as failed and will trigger a retry.




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

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