undo executorservice close

use-21-features
Mike Barry 2023-10-27 08:01:07 -04:00
rodzic dccbf78879
commit 7487205d69
2 zmienionych plików z 26 dodań i 26 usunięć

Wyświetl plik

@ -213,7 +213,7 @@ class PrometheusStats implements Stats {
@Override
public void close() {
executor.close();
executor.shutdown();
push();
}

Wyświetl plik

@ -54,7 +54,7 @@ public class Worker {
public Worker(String prefix, Stats stats, int threads, IntConsumerThatThrows task) {
this.prefix = prefix;
stats.gauge(prefix + "_threads", threads);
try (var es = Executors.newFixedThreadPool(threads, new NamedThreadFactory(prefix))) {
var es = Executors.newFixedThreadPool(threads, new NamedThreadFactory(prefix));
String parentStage = LogUtil.getStage();
List<CompletableFuture<?>> results = new ArrayList<>();
for (int i = 0; i < threads; i++) {
@ -79,9 +79,9 @@ public class Worker {
}
}, es));
}
es.shutdown();
done = joinFutures(results);
}
}
/**
* Returns a future that completes successfully when all {@code futures} complete, or fails immediately when the first