Replace LinkedBlockingQueue with LinkedTransferQueue in worker-pool

Signed-off-by: Radim Vansa <rvansa@redhat.com>
This commit is contained in:
Radim Vansa
2019-11-12 17:13:21 +01:00
committed by Julien Viet
parent ba74b71985
commit 8370289db2

View File

@@ -152,8 +152,10 @@ public class VertxImpl implements VertxInternal, MetricsProvider {
metrics = initialiseMetrics(options);
ExecutorService workerExec = Executors.newFixedThreadPool(options.getWorkerPoolSize(),
new VertxThreadFactory("vert.x-worker-thread-", checker, true, options.getMaxWorkerExecuteTime(), options.getMaxWorkerExecuteTimeUnit()));
int workerPoolSize = options.getWorkerPoolSize();
ExecutorService workerExec = new ThreadPoolExecutor(workerPoolSize, workerPoolSize,
0L, TimeUnit.MILLISECONDS, new LinkedTransferQueue<>(),
new VertxThreadFactory("vert.x-worker-thread-", checker, true, options.getMaxWorkerExecuteTime(), options.getMaxWorkerExecuteTimeUnit()));
PoolMetrics workerPoolMetrics = metrics != null ? metrics.createPoolMetrics("worker", "vert.x-worker-thread", options.getWorkerPoolSize()) : null;
ExecutorService internalBlockingExec = Executors.newFixedThreadPool(options.getInternalBlockingPoolSize(),
new VertxThreadFactory("vert.x-internal-blocking-", checker, true, options.getMaxWorkerExecuteTime(), options.getMaxWorkerExecuteTimeUnit()));