diff --git a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java index f499d0f9487..8f0cfc811b8 100644 --- a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java +++ b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java @@ -604,7 +604,9 @@ public class ZKWatcher implements Watcher, Abortable, Closeable { LOG.debug(prefix("Received ZooKeeper Event, " + "type=" + event.getType() + ", " + "state=" + event.getState() + ", " + "path=" + event.getPath())); final String spanName = ZKWatcher.class.getSimpleName() + "-" + identifier; - zkEventProcessor.execute(TraceUtil.tracedRunnable(() -> processEvent(event), spanName)); + if (!zkEventProcessor.isShutdown()) { + zkEventProcessor.execute(TraceUtil.tracedRunnable(() -> processEvent(event), spanName)); + } } // Connection management