eolivelli commented on a change in pull request #14078:
URL: https://github.com/apache/pulsar/pull/14078#discussion_r795730134



##########
File path: 
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java
##########
@@ -245,6 +250,16 @@ private synchronized void completeConnect(AuthData 
clientData) throws PulsarClie
         LOG.info("[{}] complete connection, init proxy handler. authenticated 
with {} role {}, hasProxyToBrokerUrl: {}",
             remoteAddress, authMethod, clientAuthRole, hasProxyToBrokerUrl);
         if (hasProxyToBrokerUrl) {
+            // Optimize proxy connection to fail-fast if the target broker 
isn't active
+            // Pulsar client will retry connecting after a back off timeout
+            if (service.getConfiguration().isCheckActiveBrokers()
+                    && !isBrokerActive(proxyToBrokerUrl)) {
+                ctx()
+                        .writeAndFlush(
+                                Commands.newError(-1, 
ServerError.ServiceNotReady, "Target broker isn't available."))

Review comment:
       +1 for logging.
   Actually it is better to not report the address to the client.
   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]


Reply via email to