HBASE-19321 ZKAsyncRegistry ctor would hang when zookeeper cluster is not available
This commit is contained in:
parent
9c29a6211b
commit
8c2a962d1c
|
@ -28,6 +28,7 @@ import static org.apache.hadoop.hbase.zookeeper.ZKMetadata.removeMetaData;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.apache.commons.lang3.mutable.MutableInt;
|
import org.apache.commons.lang3.mutable.MutableInt;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
@ -81,7 +82,7 @@ class ZKAsyncRegistry implements AsyncRegistry {
|
||||||
this.zk.start();
|
this.zk.start();
|
||||||
// TODO: temporary workaround for HBASE-19312, must be removed before 2.0.0 release!
|
// TODO: temporary workaround for HBASE-19312, must be removed before 2.0.0 release!
|
||||||
try {
|
try {
|
||||||
this.zk.blockUntilConnected();
|
this.zk.blockUntilConnected(2, TimeUnit.SECONDS);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue