summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-05-04 14:56:11 +0200
committerJon Marius Venstad <venstad@gmail.com>2020-05-04 14:56:11 +0200
commita5147179df7d3811c3cfe408f97672c516008302 (patch)
tree7724c075a7012a9b113e3b6fcc47bd47f3b6fc4b
parent0f27bc47f877b297e4f5acc9faf815fa06016009 (diff)
Use shutdownNow if shutdown is not enough, after 10 seconds
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunner.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunner.java
index b26375ed4e6..cfe9257bdf8 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunner.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunner.java
@@ -58,9 +58,14 @@ public class JobRunner extends ControllerMaintainer {
super.close();
executors.shutdown();
try {
- executors.awaitTermination(50, TimeUnit.SECONDS);
+ if ( ! executors.awaitTermination(10, TimeUnit.SECONDS)) {
+ executors.shutdownNow();
+ if ( ! executors.awaitTermination(40, TimeUnit.SECONDS))
+ throw new IllegalStateException("Failed shutting down " + JobRunner.class.getName());
+ }
}
catch (InterruptedException e) {
+ log.log(Level.WARNING, "Interrupted during shutdown of " + JobRunner.class.getName(), e);
Thread.currentThread().interrupt();
}
}