From 0a19f4750f5be2ebb81dfd2949993f65cc77fc9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Horacio=20Mijail=20Ant=C3=B3n=20Quiles?= <4139546+hmijail@users.noreply.github.com> Date: Sat, 22 Feb 2020 10:39:59 +0800 Subject: [PATCH] Remove unused ExecutorService init/termination (#419) Signed-off-by: Horacio Mijail Anton Quiles Co-authored-by: CJ Hare --- .../acceptance/dsl/node/ThreadBesuNodeRunner.java | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java index a73779aee6..b1445580a8 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java @@ -53,9 +53,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import io.vertx.core.Vertx; @@ -68,7 +65,6 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner { private final Logger LOG = LogManager.getLogger(); private final Map besuRunners = new HashMap<>(); - private ExecutorService nodeExecutor = Executors.newCachedThreadPool(); private final Map besuPluginContextMap = new HashMap<>(); @@ -102,9 +98,6 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner { @Override public void startNode(final BesuNode node) { - if (nodeExecutor == null || nodeExecutor.isShutdown()) { - nodeExecutor = Executors.newCachedThreadPool(); - } final StorageServiceImpl storageService = new StorageServiceImpl(); final Path dataDir = node.homeDirectory(); @@ -221,14 +214,6 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner { // iterate over a copy of the set so that besuRunner can be updated when a runner is killed new HashSet<>(besuRunners.keySet()).forEach(this::killRunner); - try { - nodeExecutor.shutdownNow(); - if (!nodeExecutor.awaitTermination(5, TimeUnit.SECONDS)) { - throw new IllegalStateException("Failed to shut down node executor"); - } - } catch (final InterruptedException e) { - throw new RuntimeException(e); - } } @Override