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 2019/04/26 05:11:12 UTC

[GitHub] [pulsar] jai1 commented on a change in pull request #4138: [pulsar-broker]Fix: client-producer can't reconnect due to failed producer-future on cnx cache

jai1 commented on a change in pull request #4138: [pulsar-broker]Fix: client-producer can't reconnect due to failed producer-future on cnx cache
URL: https://github.com/apache/pulsar/pull/4138#discussion_r278809974
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
 ##########
 @@ -851,8 +849,13 @@ protected void handleProducer(final CommandProducer cmdProducer) {
                                 // until the previous producer creation
                                 // request
                                 // either complete or fails.
-                                ServerError error = !existingProducerFuture.isDone() ? ServerError.ServiceNotReady
-                                        : getErrorCode(existingProducerFuture);
+                                ServerError error = null;
+                                if(!existingProducerFuture.isDone()) {
+                                    error = ServerError.ServiceNotReady;
+                                }else {
 
 Review comment:
   formatting is incorrect
   
   Also since you are gonna fix the formatting do you mind inverting the if condition to put `if (existingProducerFuture.isDone())` first -> Easier to read.

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


With regards,
Apache Git Services