NPEs fixed

pull/1705/head
Nikita 7 years ago
parent b8551b8424
commit 9d508ac3a3

@ -747,9 +747,11 @@ public class CommandAsyncService implements CommandAsyncExecutor {
@Override @Override
public void run(Timeout timeout) throws Exception { public void run(Timeout timeout) throws Exception {
MasterSlaveEntry entry = connectionManager.getEntry(connection.getRedisClient()); MasterSlaveEntry entry = connectionManager.getEntry(connection.getRedisClient());
ClientConnectionsEntry ee = entry.getEntry(connection.getRedisClient()); if (entry != null) {
if (ee != null && ee.getNodeType() == NodeType.SLAVE) { ClientConnectionsEntry ee = entry.getEntry(connection.getRedisClient());
ee.trySetupFistFail(); if (ee != null && ee.getNodeType() == NodeType.SLAVE) {
ee.trySetupFistFail();
}
} }
details.getAttemptPromise().tryFailure( details.getAttemptPromise().tryFailure(
@ -907,11 +909,13 @@ public class CommandAsyncService implements CommandAsyncExecutor {
free(details.getParams()); free(details.getParams());
if (!(future.cause() instanceof RedisTimeoutException)) { if (!(future.cause() instanceof RedisTimeoutException) && details.getConnectionFuture().getNow() != null) {
MasterSlaveEntry entry = connectionManager.getEntry(details.getConnectionFuture().getNow().getRedisClient()); MasterSlaveEntry entry = connectionManager.getEntry(details.getConnectionFuture().getNow().getRedisClient());
ClientConnectionsEntry ee = entry.getEntry(details.getConnectionFuture().getNow().getRedisClient()); if (entry != null) {
if (ee != null && ee.getNodeType() == NodeType.SLAVE) { ClientConnectionsEntry ee = entry.getEntry(details.getConnectionFuture().getNow().getRedisClient());
ee.resetFirstFail(); if (ee != null && ee.getNodeType() == NodeType.SLAVE) {
ee.resetFirstFail();
}
} }
} }

Loading…
Cancel
Save