diff --git a/governator-core/src/main/java/com/netflix/governator/internal/PreDestroyLifecycleFeature.java b/governator-core/src/main/java/com/netflix/governator/internal/PreDestroyLifecycleFeature.java index ce2681e4..9654f1e8 100644 --- a/governator-core/src/main/java/com/netflix/governator/internal/PreDestroyLifecycleFeature.java +++ b/governator-core/src/main/java/com/netflix/governator/internal/PreDestroyLifecycleFeature.java @@ -8,6 +8,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.concurrent.ExecutorService; import javax.annotation.PreDestroy; @@ -53,7 +54,7 @@ private class PreDestroyVisitor implements TypeVisitor, Supplier clazz) { boolean continueVisit = !clazz.isInterface(); - if (continueVisit && AutoCloseable.class.isAssignableFrom(clazz)) { + if (continueVisit && AutoCloseable.class.isAssignableFrom(clazz) && !ExecutorService.class.isAssignableFrom(clazz)) { AutoCloseableLifecycleAction closeableAction = new AutoCloseableLifecycleAction( clazz.asSubclass(AutoCloseable.class)); LOG.debug("adding action {}", closeableAction);