HBASE-25903 ReadOnlyZKClient APIs - CompletableFuture.get() calls can cause threads to hang forver when ZK client create throws Non IOException (#3293)
Signed-off-by: zhangduo <zhangduo@apache.org>
This commit is contained in:
parent
97e66a8af6
commit
1972261826
|
@ -86,7 +86,7 @@ public final class ReadOnlyZKClient implements Closeable {
|
||||||
public void exec(ZooKeeper zk) {
|
public void exec(ZooKeeper zk) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void connectFailed(IOException e) {
|
public void connectFailed(Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closed(IOException e) {
|
public void closed(IOException e) {
|
||||||
|
@ -233,7 +233,7 @@ public final class ReadOnlyZKClient implements Closeable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void connectFailed(IOException e) {
|
public void connectFailed(Exception e) {
|
||||||
if (delay(retryIntervalMs, maxRetries)) {
|
if (delay(retryIntervalMs, maxRetries)) {
|
||||||
LOG.warn("{} to {} failed to connect to zk fo {} of {}, retries = {}", getId(),
|
LOG.warn("{} to {} failed to connect to zk fo {} of {}, retries = {}", getId(),
|
||||||
connectString, operationType, path, retries, e);
|
connectString, operationType, path, retries, e);
|
||||||
|
@ -341,7 +341,7 @@ public final class ReadOnlyZKClient implements Closeable {
|
||||||
ZooKeeper zk;
|
ZooKeeper zk;
|
||||||
try {
|
try {
|
||||||
zk = getZk();
|
zk = getZk();
|
||||||
} catch (IOException e) {
|
} catch (Exception e) {
|
||||||
task.connectFailed(e);
|
task.connectFailed(e);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue