HBASE-13851 RpcClientImpl.close() can hang with cancelled replica RPCs
This commit is contained in:
parent
c1d970b04d
commit
587b0b4f20
|
@ -1113,6 +1113,16 @@ public class RpcClientImpl extends AbstractRpcClient {
|
||||||
synchronized (connections) {
|
synchronized (connections) {
|
||||||
for (Connection conn : connections.values()) {
|
for (Connection conn : connections.values()) {
|
||||||
conn.interrupt();
|
conn.interrupt();
|
||||||
|
if (conn.callSender != null) {
|
||||||
|
conn.callSender.interrupt();
|
||||||
|
}
|
||||||
|
|
||||||
|
// In case the CallSender did not setupIOStreams() yet, the Connection may not be started
|
||||||
|
// at all (if CallSender has a cancelled Call it can happen). See HBASE-13851
|
||||||
|
if (!conn.isAlive()) {
|
||||||
|
conn.markClosed(new InterruptedIOException("RpcClient is closing"));
|
||||||
|
conn.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue