HBASE-12951 TestHCM.testConnectionClose is flakey when using AsyncRpcClient as client implementation
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
a69e1b6733
commit
b8626afc88
|
@ -108,7 +108,7 @@ public class AsyncRpcChannel {
|
|||
private Token<? extends TokenIdentifier> token;
|
||||
private String serverPrincipal;
|
||||
|
||||
boolean shouldCloseConnection = false;
|
||||
volatile boolean shouldCloseConnection = false;
|
||||
private IOException closeException;
|
||||
|
||||
private Timeout cleanupTimer;
|
||||
|
@ -313,6 +313,13 @@ public class AsyncRpcChannel {
|
|||
|
||||
calls.put(call.id, call);
|
||||
|
||||
// check again, see https://issues.apache.org/jira/browse/HBASE-12951
|
||||
if (shouldCloseConnection) {
|
||||
Promise<Message> promise = channel.eventLoop().newPromise();
|
||||
promise.setFailure(new ConnectException());
|
||||
return promise;
|
||||
}
|
||||
|
||||
// Add timeout for cleanup if none is present
|
||||
if (cleanupTimer == null) {
|
||||
cleanupTimer = AsyncRpcClient.WHEEL_TIMER.newTimeout(timeoutTask, call.getRpcTimeout(),
|
||||
|
|
Loading…
Reference in New Issue