Fixed - Spring Data Redis connection in multi mode causes connection leak if it wasn't executed during RedisTemplate execution #2928

pull/970/merge
Nikita Koksharov 5 years ago
parent 5706e92744
commit 621309ab75

@ -81,6 +81,12 @@ public class RedissonConnection extends AbstractRedisConnection {
public void close() throws DataAccessException {
super.close();
if (isQueueing()) {
CommandBatchService es = (CommandBatchService) executorService;
if (!es.isExecuted()) {
discard();
}
}
closed = true;
}

@ -111,6 +111,12 @@ public class RedissonConnection extends AbstractRedisConnection {
public void close() throws DataAccessException {
super.close();
if (isQueueing()) {
CommandBatchService es = (CommandBatchService) executorService;
if (!es.isExecuted()) {
discard();
}
}
closed = true;
}

@ -117,6 +117,12 @@ public class RedissonConnection extends AbstractRedisConnection {
public void close() throws DataAccessException {
super.close();
if (isQueueing()) {
CommandBatchService es = (CommandBatchService) executorService;
if (!es.isExecuted()) {
discard();
}
}
closed = true;
}

@ -85,6 +85,12 @@ public class RedissonConnection extends AbstractRedisConnection {
public void close() throws DataAccessException {
super.close();
if (isQueueing()) {
CommandBatchService es = (CommandBatchService) executorService;
if (!es.isExecuted()) {
discard();
}
}
closed = true;
}

@ -115,6 +115,12 @@ public class RedissonConnection extends AbstractRedisConnection {
public void close() throws DataAccessException {
super.close();
if (isQueueing()) {
CommandBatchService es = (CommandBatchService) executorService;
if (!es.isExecuted()) {
discard();
}
}
closed = true;
}

@ -107,6 +107,12 @@ public class RedissonConnection extends AbstractRedisConnection {
public void close() throws DataAccessException {
super.close();
if (isQueueing()) {
CommandBatchService es = (CommandBatchService) executorService;
if (!es.isExecuted()) {
discard();
}
}
closed = true;
}

@ -107,6 +107,12 @@ public class RedissonConnection extends AbstractRedisConnection {
public void close() throws DataAccessException {
super.close();
if (isQueueing()) {
CommandBatchService es = (CommandBatchService) executorService;
if (!es.isExecuted()) {
discard();
}
}
closed = true;
}

@ -85,6 +85,9 @@ public class RedisQueuedBatchExecutor<V, R> extends BaseRedisBatchExecutor<V, R>
if (RedisCommands.EXEC.getName().equals(command.getName())) {
super.releaseConnection(attemptPromise, connectionFuture);
}
if (RedisCommands.DISCARD.getName().equals(command.getName())) {
super.releaseConnection(attemptPromise, connectionFuture);
}
}
@Override

Loading…
Cancel
Save