Skip to content

Commit 674ed7c

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 9dff47f commit 674ed7c

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
*
@@ -658,7 +659,7 @@ private boolean subscribeLock(long time) throws ExecutionException, InterruptedE
658659
}
659660

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

0 commit comments

Comments
 (0)