HBASE-11851 RpcClient can try to close a connection not ready to close
This commit is contained in:
parent
ce4af20ad3
commit
d12ad17381
@ -732,11 +732,8 @@ public class RpcClient {
|
||||
// beware of the concurrent access to the calls list: we can add calls, but as well
|
||||
// remove them.
|
||||
long waitUntil = EnvironmentEdgeManager.currentTimeMillis() + minIdleTimeBeforeClose;
|
||||
while (!shouldCloseConnection.get() && running.get() &&
|
||||
EnvironmentEdgeManager.currentTimeMillis() < waitUntil && calls.isEmpty()) {
|
||||
wait(Math.min(minIdleTimeBeforeClose, 1000));
|
||||
}
|
||||
|
||||
while (true) {
|
||||
if (shouldCloseConnection.get()) {
|
||||
return false;
|
||||
}
|
||||
@ -762,9 +759,8 @@ public class RpcClient {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We can get here if we received a notification that there is some work to do but
|
||||
// the work was cancelled. As we're not idle we continue to wait.
|
||||
return false;
|
||||
wait(Math.min(minIdleTimeBeforeClose, 1000));
|
||||
}
|
||||
}
|
||||
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user