Fix shutdown hook.
MODIFY
utils/thread-utils/src/main/java/datadog/common/exec/SharedExecutors.java
utils/thread-utils/src/main/java/datadog/common/exec/SharedExecutors.java
@@ -45,11 +45,13 @@ public final class SharedExecutors {
@Override
public void run() {
- try {
executorService.shutdown();
- executorService.awaitTermination(SHUTDOWN_WAIT_SECONDS, TimeUnit.SECONDS);
+ try {
+ if (!executorService.awaitTermination(SHUTDOWN_WAIT_SECONDS, TimeUnit.SECONDS)) {
+ executorService.shutdownNow();
+ }
} catch (final InterruptedException e) {
- // Don't bother waiting then...
+ executorService.shutdownNow();
}
}
}

Fix shutdown hook.