HBASE-19321 ZKAsyncRegistry ctor would hang when zookeeper cluster is not available

This commit is contained in:
wuguoquan 2017-11-22 13:46:51 +08:00 committed by zhangduo
parent 1a4037b9dc
commit 7acf3f9a9c
1 changed files with 2 additions and 1 deletions

View File

@ -28,6 +28,7 @@ import static org.apache.hadoop.hbase.zookeeper.ZKMetadata.removeMetaData;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang3.mutable.MutableInt;
import org.apache.commons.logging.Log;
@ -81,7 +82,7 @@ class ZKAsyncRegistry implements AsyncRegistry {
this.zk.start();
// TODO: temporary workaround for HBASE-19312, must be removed before 2.0.0 release!
try {
this.zk.blockUntilConnected();
this.zk.blockUntilConnected(2, TimeUnit.SECONDS);
} catch (InterruptedException e) {
return;
}