Repository: hbase
Updated Branches:
  refs/heads/branch-1 cb3bef357 -> 9d481b1c4
  refs/heads/branch-1.4 795f0e402 -> ed9c8b1cf


HBASE-19239 (addendum) Fix findbugs and error-prone warnings (branch-1)

Signed-off-by: Andrew Purtell <apurt...@apache.org>


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

Branch: refs/heads/branch-1.4
Commit: ed9c8b1cfe22e3e59cf551fc30cb842a1f5004d2
Parents: 795f0e4
Author: Guanghao Zhang <zg...@apache.org>
Authored: Sat Dec 2 20:30:56 2017 +0800
Committer: Andrew Purtell <apurt...@apache.org>
Committed: Mon Dec 4 10:18:29 2017 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hbase/master/ClusterStatusPublisher.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ed9c8b1c/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ClusterStatusPublisher.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ClusterStatusPublisher.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ClusterStatusPublisher.java
index 00c738b..95b1cd5 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ClusterStatusPublisher.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ClusterStatusPublisher.java
@@ -99,7 +99,7 @@ public class ClusterStatusPublisher extends ScheduledChore {
   private final ConcurrentMap<ServerName, Integer> lastSent =
       new ConcurrentHashMap<ServerName, Integer>();
   private Publisher publisher;
-  private boolean connected = false;
+  private volatile boolean connected = false;
 
   /**
    * We want to limit the size of the protobuf message sent, do fit into a 
single packet.
@@ -169,9 +169,11 @@ public class ClusterStatusPublisher extends ScheduledChore 
{
   }
 
   @Override
-  protected synchronized void cleanup() {
+  protected void cleanup() {
     connected = false;
-    publisher.close();
+    synchronized (this) {
+      publisher.close();
+    }
   }
 
   /**

Reply via email to