apurtell commented on a change in pull request #1039: HBASE-23647: Make 
MasterRegistry the default impl.
URL: https://github.com/apache/hbase/pull/1039#discussion_r369863370
 
 

 ##########
 File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java
 ##########
 @@ -133,11 +133,19 @@ public void 
testMasterShutdownBeforeStartingAnyRegionServer() throws Exception {
     util.startMiniZKCluster();
     util.createRootDir();
     final LocalHBaseCluster cluster =
-        new LocalHBaseCluster(conf, NUM_MASTERS, NUM_RS, HMaster.class,
+        new LocalHBaseCluster(conf, NUM_MASTERS, 0, NUM_RS, HMaster.class,
             MiniHBaseCluster.MiniHBaseClusterRegionServer.class);
     final int MASTER_INDEX = 0;
     final MasterThread master = cluster.getMasters().get(MASTER_INDEX);
     master.start();
+    // Switching to master registry exposed a race in the master bootstrap 
that can result in a
+    // lost shutdown command (essentially HBASE-8422). The race is essentially 
because the
+    // server manager in HMaster is not initialized by the time shutdown() RPC 
(below) is made to
+    // the master. The reason it was not happening earlier is because the 
connection creation with
+    // ZK registry is so slow that by then the server manager is init'ed thus 
masking the problem.
+    // For now, I'm putting a sleep here to workaround the issue, I think the 
fix for it is a little
+    // delicate and needs to be done separately.
+    Thread.sleep(5000);
 
 Review comment:
   Is it possible to use Waiter#waitFor to wait on some condition variable or 
predicate? Hard coded sleeps in tests tend to fall over on Apache Jenkins 
because of load issues ie the sleeps can never be long enough...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to