HBASE-11851 RpcClient can try to close a connection not ready to close

This commit is contained in:
Nicolas Liochon 2014-08-29 14:35:57 +02:00
parent ce4af20ad3
commit d12ad17381

View File

@ -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() {