You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by GitBox <gi...@apache.org> on 2021/06/01 13:44:45 UTC

[GitHub] [tinkerpop] spmallette commented on a change in pull request #1422: TINKERPOP-2569 Reconnect if java driver fails to initialize

spmallette commented on a change in pull request #1422:
URL: https://github.com/apache/tinkerpop/pull/1422#discussion_r643116539



##########
File path: gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ConnectionPool.java
##########
@@ -111,8 +111,11 @@ public ConnectionPool(final Host host, final Client client, final Optional<Integ
             logger.warn("Initialization of connections cancelled for {}", getPoolInfo(), ce);
             throw ce;
         } catch (CompletionException ce) {
-            // Some connections might have been initialized. Close the connection pool gracefully to close them.
-            this.closeAsync();
+            // since there was some error here, the host is likely unavailable at this point. if we dont mark it as
+            // such the client won't try to reconnect to the dead host. need to initialize this.open because if we
+            // don't then reconnects will fail when trying to create a new one with addConnectionIfUnderMaximum()
+            this.open = new AtomicInteger(0);
+            considerHostUnavailable();

Review comment:
       i'd forgotten we removed that and when i was looking at the user concern i'd remembered only how it used to work. maybe i can make some aspect of this "better" in a different fashion that doesn't bring all those problems you mentioned.




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