hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject git commit: HBASE-11923 Potential race condition in RecoverableZookeeper.checkZk() (Lars Hofhansl)
Date Wed, 10 Sep 2014 01:45:43 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 b29394c2a -> 5e7f646b3


HBASE-11923 Potential race condition in RecoverableZookeeper.checkZk() (Lars Hofhansl)


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

Branch: refs/heads/0.98
Commit: 5e7f646b3a70b496e80daf768b6936d7f56acb11
Parents: b29394c
Author: Enis Soztutar <enis@apache.org>
Authored: Tue Sep 9 18:35:53 2014 -0700
Committer: Enis Soztutar <enis@apache.org>
Committed: Tue Sep 9 18:44:44 2014 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5e7f646b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
index ee2fd0f..512f0e5 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
@@ -75,7 +75,7 @@ import org.cloudera.htrace.TraceScope;
 public class RecoverableZooKeeper {
   private static final Log LOG = LogFactory.getLog(RecoverableZooKeeper.class);
   // the actual ZooKeeper client instance
-  volatile private ZooKeeper zk;
+  private ZooKeeper zk;
   private final RetryCounterFactory retryCounterFactory;
   // An identifier of this process in the cluster
   private final String identifier;
@@ -134,7 +134,7 @@ public class RecoverableZooKeeper {
    * @return The created Zookeeper connection object
    * @throws KeeperException
    */
-  protected ZooKeeper checkZk() throws KeeperException {
+  protected synchronized ZooKeeper checkZk() throws KeeperException {
     if (this.zk == null) {
       try {
         this.zk = new ZooKeeper(quorumServers, sessionTimeout, watcher);
@@ -146,7 +146,7 @@ public class RecoverableZooKeeper {
     return zk;
   }
 
-  public void reconnectAfterExpiration()
+  public synchronized void reconnectAfterExpiration()
         throws IOException, KeeperException, InterruptedException {
     if (zk != null) {
       LOG.info("Closing dead ZooKeeper connection, session" +


Mime
View raw message