simonz-bq commented on code in PR #1709:
URL: https://github.com/apache/tinkerpop/pull/1709#discussion_r909095165


##########
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ConnectionPool.java:
##########
@@ -382,35 +344,49 @@ private Connection waitForConnection(final long timeout, 
final TimeUnit unit) th
         long start = System.nanoTime();
         long remaining = timeout;
         long to = timeout;
-        do {
-            try {
-                awaitAvailableConnection(remaining, unit);
-            } catch (InterruptedException e) {
-                Thread.currentThread().interrupt();
-                to = 0;
+
+        Connection leastUsed = selectLeastUsed();

Review Comment:
   I am confused as to what is being proposed here.
   
   This is more or less the way the existing logic is written. The ticket was 
created with the acceptance criteria to avoid the duplication of the checking 
in scenario 2 and 3, where now it is combined into a single point of checking 
in `waitForConnection`. 
   
   Whilst I agree that it is now less readable, unfortunately this is the 
result. 
   
   I will add some comments to make it more clear what is happening.



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