ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] alex-plekhanov commented on a change in pull request #6595: IGNITE-11685 Java thin client: Handle multiple async requests in parallel
Date Thu, 04 Jul 2019 15:38:07 GMT
alex-plekhanov commented on a change in pull request #6595: IGNITE-11685 Java thin client:
Handle multiple async requests in parallel
URL: https://github.com/apache/ignite/pull/6595#discussion_r300447801
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java
 ##########
 @@ -80,32 +76,34 @@
 
         List<InetSocketAddress> addrs = parseAddresses(clientCfg.getAddresses());
 
+        srvCnt = addrs.size();
+
         primary = addrs.get(new Random().nextInt(addrs.size())); // we already verified there
is at least one address
 
         for (InetSocketAddress a : addrs) {
             if (a != primary)
-                this.backups.add(a);
+                backups.add(a);
         }
 
         ClientConnectionException lastEx = null;
 
         for (int i = 0; i < addrs.size(); i++) {
             try {
-                ch = chFactory.apply(new ClientChannelConfiguration(clientCfg).setAddress(primary)).get();
+                ch = chFactory.apply(new ClientChannelConfiguration(clientCfg).setAddress(addrs.get(i))).get();
 
 Review comment:
   It throws an exception if it can't establish a connection to all nodes (exception is not
thrown if connected to at least one node from the address list).
   Actually, I've reverted fix for this line, since `primary` is changed in `changeServer`
method and there was no error in the original implementation (I misunderstood this behavior).

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

Mime
View raw message