ctubbsii commented on code in PR #5853:
URL: https://github.com/apache/accumulo/pull/5853#discussion_r2326257522


##########
core/src/test/java/org/apache/accumulo/core/crypto/CryptoTest.java:
##########
@@ -539,14 +540,18 @@ private void testMultipleThreads(Scope scope) throws 
Exception {
 
     var executor = Executors.newCachedThreadPool();
 
-    List<Future<Boolean>> verifyFutures = new ArrayList<>();
+    final int numTasks = 32;
+    List<Future<Boolean>> verifyFutures = new ArrayList<>(numTasks);
+    CountDownLatch startLatch = new CountDownLatch(numTasks);

Review Comment:
   For what it's worth, `Executors.newCachedThreadPool` is prone to the kind of 
deadlock issue I mentioned, because it does use a maximum size, which could be 
smaller than the number of tasks you have. Initially, it is `Integer.MAX_VALUE` 
in my JDK, but that is an implementation detail, not a guarantee. The maximum 
size can also be explicitly adjusted with a method call, which could lead to 
the deadlock if adjusted lower than the number of tasks.



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