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


##########
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:
   1) Yeah, I think if we just ensure there are enough threads for all the test 
cases you changed, I am good with the current changes.
   2) Yeah, I did not mean for this to be something done in this PR, should be 
follow on
   3) I agree, in your solution we ensure all of them start their work at the 
same time, which isn't the case with signaling start after the loop that 
submits them
   
   Also thought of https://github.com/apache/accumulo/pull/5801 which uses a 
latch of 1 and an atomic int to keep track of how many are waiting, but this is 
just a more complicated version of your solution.
   
   I think the current changes are the best solution, just need to ensure there 
are enough threads :+1: 



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