From 68d509bc1ff7a3bf69a596aed49f238b42ee0679 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Fri, 16 Feb 2018 20:11:03 -0800 Subject: [PATCH] HBASE-20013 TestZKPermissionWatcher is flakey --- .../apache/hadoop/hbase/master/HMaster.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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 02fbc028bbd..b949aa98ae0 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 @@ -2718,11 +2718,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(); + } } /**