ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] pavlukhin commented on a change in pull request #6595: IGNITE-11685 Java thin client: Handle multiple async requests in parallel
Date Thu, 04 Jul 2019 09:32:38 GMT
pavlukhin 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_r300279681
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java
 ##########
 @@ -216,19 +191,30 @@ public ProtocolVersion serverVersion() {
     }
 
     /** */
-    private void changeServer() {
-        if (!backups.isEmpty()) {
-            backups.addLast(primary);
+    private synchronized ClientChannel channel() {
+        if (ch == null)
+            ch = chFactory.apply(new ClientChannelConfiguration(clientCfg).setAddress(primary)).get();
 
-            primary = backups.removeFirst();
-        }
+        return ch;
+    }
 
-        try {
-            ch.close();
-        }
-        catch (Exception ignored) {
-        }
+    /** */
+    private synchronized void changeServer(ClientChannel oldCh) {
+        if (oldCh == ch && ch != null) {
+            if (!backups.isEmpty()) {
 
 Review comment:
   @alex-plekhanov can we improve processing for a single server case by adding special code
paths for that case, what do you think? Also, naming primary/backup seems odd to me, it might
be better to keep and use them from rolling list. Perhaps, all points are for a separate ticket.

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