RobertIndie commented on code in PR #336:
URL: https://github.com/apache/pulsar-client-cpp/pull/336#discussion_r1376988417


##########
lib/ConnectionPool.cc:
##########
@@ -34,13 +34,13 @@ DECLARE_LOG_OBJECT()
 namespace pulsar {
 
 ConnectionPool::ConnectionPool(const ClientConfiguration& conf, 
ExecutorServiceProviderPtr executorProvider,
-                               const AuthenticationPtr& authentication, bool 
poolConnections,
-                               const std::string& clientVersion)
+                               const AuthenticationPtr& authentication, const 
std::string& clientVersion)
     : clientConfiguration_(conf),
       executorProvider_(executorProvider),
       authentication_(authentication),
-      poolConnections_(poolConnections),
-      clientVersion_(clientVersion) {}
+      clientVersion_(clientVersion),
+      randomDistribution_(0, conf.getConnectionsPerBroker()),

Review Comment:
   ```suggestion
         randomDistribution_(0, conf.getConnectionsPerBroker() - 1),
   ```
   
   The range is left-closed and right-closed. We need to `-1` here to make sure 
the total number of the connections to be equal to 
`conf.getConnectionsPerBroker()`.



-- 
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-unsubscr...@pulsar.apache.org

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

Reply via email to