Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

#192 shut down client thread pool on shutdown #194

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.janusgraph.diskstorage.BackendException;
Expand Down Expand Up @@ -856,6 +857,12 @@ public void shutdown() {
MetricManager.INSTANCE.getRegistry().remove(executorGaugeName);
// TODO(amcp) figure out a way to make the thread pool not be static
// https://github.com/awslabs/dynamodb-titan-storage-backend/issues/48
clientThreadPool.shutdown();
try {
clientThreadPool.awaitTermination(5L, TimeUnit.SECONDS);
} catch (InterruptedException e) {
throw new IllegalStateException("Shutdown was interrupted", e);
}
client.shutdown();
}

Expand Down