You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2022/10/17 20:26:17 UTC
[hbase] branch master updated: HBASE-27426 - Fix ZKWatcher shutdown seqence to avoid InterruptExcept… (#4829)
This is an automated email from the ASF dual-hosted git repository.
apurtell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new 77a21b93c51 HBASE-27426 - Fix ZKWatcher shutdown seqence to avoid InterruptExcept… (#4829)
77a21b93c51 is described below
commit 77a21b93c517d98e971319c96f1551fa2df0d77a
Author: Victor <vl...@gmail.com>
AuthorDate: Mon Oct 17 13:26:09 2022 -0700
HBASE-27426 - Fix ZKWatcher shutdown seqence to avoid InterruptExcept… (#4829)
Signed-off-by: Andrew Purtell <ap...@apache.org>
Signed-off-by: Viraj Jasani <vj...@apache.org>
Co-authored-by: Victor Li <vi...@salesforce.com>
---
.../java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
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 9608ffc17c6..f499d0f9487 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
@@ -735,12 +735,20 @@ public class ZKWatcher implements Watcher, Abortable, Closeable {
*/
@Override
public void close() {
+ zkEventProcessor.shutdown();
try {
- recoverableZooKeeper.close();
+ if (!zkEventProcessor.awaitTermination(15, TimeUnit.SECONDS)) {
+ LOG.warn("ZKWatcher event processor has not finished to terminate.");
+ zkEventProcessor.shutdownNow();
+ }
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} finally {
- zkEventProcessor.shutdownNow();
+ try {
+ recoverableZooKeeper.close();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
}
}