Repository: hbase
Updated Branches:
  refs/heads/branch-2.0 4ffdca6f2 -> 4ee707a53


HBASE-20362 TestMasterShutdown.testMasterShutdownBeforeStartingAnyRegionServer 
is flaky


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

Branch: refs/heads/branch-2.0
Commit: 4ee707a53dd525993c242ffd10b241ec5d53145e
Parents: 4ffdca6
Author: zhangduo <zhang...@apache.org>
Authored: Sun Apr 8 15:31:02 2018 +0800
Committer: zhangduo <zhang...@apache.org>
Committed: Mon Apr 9 14:56:34 2018 +0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/client/Admin.java   | 15 ++++++++++++---
 .../hadoop/hbase/master/TestMasterShutdown.java      | 12 ++++++------
 2 files changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/4ee707a5/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
index 40dac2f..1c56ebb 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -1415,15 +1414,25 @@ public interface Admin extends Abortable, Closeable {
       throws IOException;
 
   /**
+   * <p>
    * Shuts down the HBase cluster.
-   *
+   * </p>
+   * <p>
+   * Notice that, a success shutdown call may ends with an error since the 
remote server has already
+   * been shutdown.
+   * </p>
    * @throws IOException if a remote or network exception occurs
    */
   void shutdown() throws IOException;
 
   /**
+   * <p>
    * Shuts down the current HBase master only. Does not shutdown the cluster.
-   *
+   * </p>
+   * <p>
+   * Notice that, a success stopMaster call may ends with an error since the 
remote server has
+   * already been shutdown.
+   * </p>
    * @throws IOException if a remote or network exception occurs
    * @see #shutdown()
    */

http://git-wip-us.apache.org/repos/asf/hbase/blob/4ee707a5/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java
index 4c51026..63cfe1f 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java
@@ -55,7 +55,6 @@ public class TestMasterShutdown {
    * <p>
    * Starts with three masters.  Tells the active master to shutdown the 
cluster.
    * Verifies that all masters are properly shutdown.
-   * @throws Exception
    */
   @Test
   public void testMasterShutdown() throws Exception {
@@ -130,17 +129,18 @@ public class TestMasterShutdown {
       public void run() {
         LOG.info("Before call to shutdown master");
         try {
-          try (Connection connection =
-              ConnectionFactory.createConnection(util.getConfiguration())) {
+          try (
+            Connection connection = 
ConnectionFactory.createConnection(util.getConfiguration())) {
             try (Admin admin = connection.getAdmin()) {
               admin.shutdown();
             }
           }
-          LOG.info("After call to shutdown master");
-          cluster.waitOnMaster(MASTER_INDEX);
         } catch (Exception e) {
+          LOG.info("Error while calling Admin.shutdown, which is expected: " + 
e.getMessage());
         }
-      };
+        LOG.info("After call to shutdown master");
+        cluster.waitOnMaster(MASTER_INDEX);
+      }
     };
     shutdownThread.start();
     LOG.info("Called master join on " + master.getName());

Reply via email to