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



##########
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:
       It doesn't seem to be necessary to report to the client since the client 
has the information about the target broker.
   I guess there could be logging with WARN level in this case?




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