HBASE-9198 RpcClient#call could hang

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1513582 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
jxiang 2013-08-13 16:27:42 +00:00
parent ade6149e37
commit 0a84963bb8
1 changed files with 4 additions and 1 deletions

View File

@ -1366,8 +1366,11 @@ public class RpcClient {
//noinspection SynchronizationOnLocalVariableOrMethodParameter
synchronized (call) {
while (!call.done) {
if (connection.shouldCloseConnection.get()) {
throw new IOException("Unexpected closed connection");
}
try {
call.wait(); // wait for the result
call.wait(1000); // wait for the result
} catch (InterruptedException ignored) {
// save the fact that we were interrupted
interrupted = true;