From ea82b9c72fb6417e883ebe27d017b699674e6687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andor=20Moln=C3=A1r?= Date: Fri, 28 Apr 2023 16:46:22 +0200 Subject: [PATCH] HBASE-27810. Check if the executor has already been shut down before submitting new job (#5207) Signed-off-by: Wellington Chevreuil Signed-off-by: Duo Zhang (cherry picked from commit a6e89bf624d70a7f220f961e4f8808374400d774) --- .../java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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