diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-06-04 14:02:24 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-06-04 14:11:59 +0200 |
commit | d4ab7939241495a43e9ed170a99901b28602997f (patch) | |
tree | 7593aa6c1d10dd09c5ab542c0e25762dd04b5b74 /container-core/src | |
parent | bb327c878fcfbfd2b0154a5d0983fd1dec29d0e6 (diff) |
Force usage of ContainerThreadPool through Executor provider
Diffstat (limited to 'container-core/src')
3 files changed, 3 insertions, 8 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/handler/ThreadPoolProvider.java b/container-core/src/main/java/com/yahoo/container/handler/ThreadPoolProvider.java index 1ec5455dacd..425387039ff 100644 --- a/container-core/src/main/java/com/yahoo/container/handler/ThreadPoolProvider.java +++ b/container-core/src/main/java/com/yahoo/container/handler/ThreadPoolProvider.java @@ -46,7 +46,7 @@ public class ThreadPoolProvider extends AbstractComponent implements Provider<Ex */ @Override public void deconstruct() { - threadpool.deconstruct(); + threadpool.close(); } } diff --git a/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java b/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java index 3789d5cbedc..6fc9da298a8 100644 --- a/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java +++ b/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java @@ -1,8 +1,6 @@ // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.handler.threadpool; -import com.google.inject.Inject; -import com.yahoo.component.AbstractComponent; import com.yahoo.concurrent.ThreadFactoryFactory; import com.yahoo.container.handler.ThreadpoolConfig; import com.yahoo.container.protect.ProcessTerminator; @@ -22,11 +20,10 @@ import java.util.concurrent.TimeUnit; * @author bratseth * @author bjorncs */ -public class ContainerThreadPool extends AbstractComponent implements AutoCloseable { +public class ContainerThreadPool implements AutoCloseable { private final ExecutorServiceWrapper threadpool; - @Inject public ContainerThreadPool(ThreadpoolConfig config, Metric metric) { this(config, metric, new ProcessTerminator()); } @@ -50,7 +47,6 @@ public class ContainerThreadPool extends AbstractComponent implements AutoClosea } public Executor executor() { return threadpool; } - @Override public void deconstruct() { closeInternal(); } @Override public void close() { closeInternal(); } /** @@ -60,7 +56,6 @@ public class ContainerThreadPool extends AbstractComponent implements AutoClosea private void closeInternal() { boolean terminated; - super.deconstruct(); threadpool.shutdown(); try { terminated = threadpool.awaitTermination(1, TimeUnit.SECONDS); diff --git a/container-core/src/test/java/com/yahoo/container/handler/threadpool/ContainerThreadPoolTest.java b/container-core/src/test/java/com/yahoo/container/handler/threadpool/ContainerThreadPoolTest.java index 7998bbc4872..f6a3aebd7ff 100644 --- a/container-core/src/test/java/com/yahoo/container/handler/threadpool/ContainerThreadPoolTest.java +++ b/container-core/src/test/java/com/yahoo/container/handler/threadpool/ContainerThreadPoolTest.java @@ -44,7 +44,7 @@ public class ContainerThreadPoolTest { if (reply.second != Boolean.TRUE) { fail("Executor task seemed to run, but did not get correct value."); } - threadPool.deconstruct(); + threadPool.close(); command = new FlipIt(); try { exec.execute(command); |