Remove unused ExecutorService init/termination (#419)

Signed-off-by: Horacio Mijail Anton Quiles <hmijail@gmail.com>

Co-authored-by: CJ Hare <CjHare@users.noreply.github.com>
pull/425/head
Horacio Mijail Antón Quiles 5 years ago committed by GitHub
parent 3603f8d14d
commit 0a19f4750f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      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.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; 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 java.util.stream.Collectors;
import io.vertx.core.Vertx; import io.vertx.core.Vertx;
@ -68,7 +65,6 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
private final Logger LOG = LogManager.getLogger(); private final Logger LOG = LogManager.getLogger();
private final Map<String, Runner> besuRunners = new HashMap<>(); private final Map<String, Runner> besuRunners = new HashMap<>();
private ExecutorService nodeExecutor = Executors.newCachedThreadPool();
private final Map<Node, BesuPluginContextImpl> besuPluginContextMap = new HashMap<>(); private final Map<Node, BesuPluginContextImpl> besuPluginContextMap = new HashMap<>();
@ -102,9 +98,6 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
@Override @Override
public void startNode(final BesuNode node) { public void startNode(final BesuNode node) {
if (nodeExecutor == null || nodeExecutor.isShutdown()) {
nodeExecutor = Executors.newCachedThreadPool();
}
final StorageServiceImpl storageService = new StorageServiceImpl(); final StorageServiceImpl storageService = new StorageServiceImpl();
final Path dataDir = node.homeDirectory(); 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 // 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); 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 @Override

Loading…
Cancel
Save