HBASE-20013 TestZKPermissionWatcher is flakey

Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3ea2ffcd
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3ea2ffcd
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3ea2ffcd

Branch: refs/heads/branch-2
Commit: 3ea2ffcd57df3eeb2a996ddc8b229449c8a9f87e
Parents: 7219365
Author: Michael Stack <st...@apache.org>
Authored: Fri Feb 16 20:11:03 2018 -0800
Committer: Michael Stack <st...@apache.org>
Committed: Fri Feb 16 23:19:07 2018 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/master/HMaster.java   | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3ea2ffcd/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index aa22130..dcab9f4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -2729,11 +2729,21 @@ public class HMaster extends HRegionServer implements 
MasterServices {
     }
   }
 
-  void checkInitialized()
-      throws PleaseHoldException, ServerNotRunningYetException, 
MasterNotRunningException {
+  public static class MasterStoppedException extends DoNotRetryIOException {
+    MasterStoppedException() {
+      super();
+    }
+  }
+
+  void checkInitialized() throws PleaseHoldException, 
ServerNotRunningYetException,
+      MasterNotRunningException, MasterStoppedException {
     checkServiceStarted();
-    if (!isInitialized()) throw new PleaseHoldException("Master is 
initializing");
-    if (isStopped()) throw new MasterNotRunningException();
+    if (!isInitialized()) {
+      throw new PleaseHoldException("Master is initializing");
+    }
+    if (isStopped()) {
+      throw new MasterStoppedException();
+    }
   }
 
   /**

Reply via email to