bhabegger commented on code in PR #2679:
URL: https://github.com/apache/jackrabbit-oak/pull/2679#discussion_r2685767570
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/Downloader.java:
##########
@@ -128,26 +126,8 @@ public Downloader(int concurrency, int connectTimeoutMs,
int readTimeoutMs, int
this.checksumAlgorithm = null;
}
this.bufferSize = bufferSize;
-
- // The maximum number of threads in each executor service,
- // when using a LinkedBlockingQueue(), is corePoolSize.
- // all other tasks are kept in the LinkedBlockingQueue, which
- // is unbounded.
- // (Using a bounded queue, such as SynchronousQueue,
- // would result in RejectedExecutionHandler).
- // We want to keep things simple and don't want
- // to use back presssure or other mechanisms.
- // So in summary, corePoolSize threads are used, per service.
- this.executorService = new ThreadPoolExecutor(
- corePoolSize, concurrency, 60L, TimeUnit.SECONDS,
- new LinkedBlockingQueue<>(),
-
BasicThreadFactory.builder().namingPattern("downloader-%d").daemon().build()
- );
- this.executorServiceForParts = new ThreadPoolExecutor(
- corePoolSize, concurrency, 60L, TimeUnit.SECONDS,
- new LinkedBlockingQueue<>(),
-
BasicThreadFactory.builder().namingPattern("partDownloader-%d").daemon().build()
- );
+ this.executorService =
ExecutorHelper.linkedQueueExecutor(corePoolSize, "downloader-%d");
Review Comment:
Here the behavior will be the same as in both before and after
`corePoolSize` threads will be created and will never change.
--
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]