kevinrr888 commented on code in PR #5853:
URL: https://github.com/apache/accumulo/pull/5853#discussion_r2325795286
##########
test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java:
##########
@@ -893,7 +893,7 @@ public void testUniquenessOfTableId() throws
ExecutionException, InterruptedExce
Set<TableId> hash = new HashSet<>();
- ExecutorService pool = Executors.newFixedThreadPool(64);
+ ExecutorService pool = Executors.newCachedThreadPool();
for (int i = 0; i < 1000; i++) {
int finalI = i;
Review Comment:
Looks like this will submit 1000 tasks, wonder if a cached thread pool can
be a problem here. If the tasks run really slowly, this could create many
threads. Might be unlikely but still possible. This is not possible with a
fixed pool
##########
core/src/test/java/org/apache/accumulo/core/util/LockMapTest.java:
##########
@@ -91,7 +91,7 @@ public void testMultiClose() {
@Test
public void testConcurrency() throws Exception {
final int numThreads = 32;
- var executor = Executors.newFixedThreadPool(numThreads);
+ var executor = Executors.newCachedThreadPool();
final int numTasks = numThreads * 4;
Review Comment:
maybe `numThreads` should be renamed. Or could just keep it as fixed since
numThreads = the number of threads = the latch value
##########
test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java:
##########
@@ -282,7 +282,7 @@ public void testSuccessfulCompaction() throws Exception {
final AtomicBoolean fail = new AtomicBoolean(false);
final int THREADS = 5;
for (int count = 0; count < THREADS; count++) {
- ExecutorService executor = Executors.newFixedThreadPool(THREADS);
+ ExecutorService executor = Executors.newCachedThreadPool();
final int span = 500000 / 59;
for (int i = 0; i < 500000; i += 500000 / 59) {
final int finalI = i;
Review Comment:
Another case of many tasks being submitted to a cached pool
--
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]