Skip to content

Commit 50c0b26

Browse files
alexpeelmanspring-builds
authored andcommitted
GH-9401: RedisLockRegistry: use lock() instead of tryLock() for lifecycle
Fixes: #9401 Switched `tryLock()` with `lock()` in `RedisLockRegistry.runRedisMessageListenerContainer()` method for correct synchronization. (cherry picked from commit 07085a1)
1 parent cb09a84 commit 50c0b26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
* @author Eddie Cho
8787
* @author Myeonghyeon Lee
8888
* @author Roman Zabaluev
89+
* @author Alex Peelman
8990
*
9091
* @since 4.0
9192
*
@@ -657,7 +658,7 @@ private boolean subscribeLock(long time) throws ExecutionException, InterruptedE
657658
}
658659

659660
private void runRedisMessageListenerContainer() {
660-
RedisLockRegistry.this.lock.tryLock();
661+
RedisLockRegistry.this.lock.lock();
661662
try {
662663
if (!(RedisLockRegistry.this.isRunningRedisMessageListenerContainer
663664
&& RedisLockRegistry.this.redisMessageListenerContainer != null

0 commit comments

Comments
 (0)