findepi commented on code in PR #4561:
URL: https://github.com/apache/accumulo/pull/4561#discussion_r1602624581


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/ThriftTransportPool.java:
##########
@@ -76,7 +76,8 @@ private ThriftTransportPool(LongSupplier maxAgeMillis) {
         final long minNanos = MILLISECONDS.toNanos(250);
         final long maxNanos = MINUTES.toNanos(1);
         long lastRun = System.nanoTime();
-        while (!connectionPool.shutdown) {
+        // loop often, to detect shutdowns quickly
+        while (!connectionPool.awaitShutdown(250)) {

Review Comment:
   good point. CountDownLatch definitely simplifies the wait/wake.
   I didn't replace the `shutdown` variable yet. it's checked in other places 
without waiting. `CountDownLatch.getCount` is documented as "This method is 
typically used for debugging and testing purposes.", so was hesitant. Should I?



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