fix npe when connection is not established. (#6534)
This commit is contained in:
parent
4c1175acf0
commit
1a3c8cfb60
@ -455,7 +455,6 @@ public abstract class RpcClient implements Closeable {
|
|||||||
rpcClientStatus.set(RpcClientStatus.SHUTDOWN);
|
rpcClientStatus.set(RpcClientStatus.SHUTDOWN);
|
||||||
LOGGER.info("Shutdown client event executor " + clientEventExecutor);
|
LOGGER.info("Shutdown client event executor " + clientEventExecutor);
|
||||||
clientEventExecutor.shutdownNow();
|
clientEventExecutor.shutdownNow();
|
||||||
LOGGER.info("Close current connection " + currentConnection.getConnectionId());
|
|
||||||
closeConnection(currentConnection);
|
closeConnection(currentConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,6 +586,7 @@ public abstract class RpcClient implements Closeable {
|
|||||||
|
|
||||||
private void closeConnection(Connection connection) {
|
private void closeConnection(Connection connection) {
|
||||||
if (connection != null) {
|
if (connection != null) {
|
||||||
|
LOGGER.info("Close current connection " + connection.getConnectionId());
|
||||||
connection.close();
|
connection.close();
|
||||||
eventLinkedBlockingQueue.add(new ConnectionEvent(ConnectionEvent.DISCONNECTED));
|
eventLinkedBlockingQueue.add(new ConnectionEvent(ConnectionEvent.DISCONNECTED));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user