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 2022/06/29 00:15:03 UTC
[GitHub] [tinkerpop] simonz-bq commented on a diff in pull request #1709: TINKERPOP-2617 Clean up Java connection pool logic
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: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org