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 07085a17ae)
This commit is contained in:
committed by
Spring Builds
parent
9dff47fcf6
commit
674ed7c228
@@ -86,6 +86,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
* @author Eddie Cho
|
||||
* @author Myeonghyeon Lee
|
||||
* @author Roman Zabaluev
|
||||
* @author Alex Peelman
|
||||
*
|
||||
* @since 4.0
|
||||
*
|
||||
@@ -658,7 +659,7 @@ public final class RedisLockRegistry implements ExpirableLockRegistry, Disposabl
|
||||
}
|
||||
|
||||
private void runRedisMessageListenerContainer() {
|
||||
RedisLockRegistry.this.lock.tryLock();
|
||||
RedisLockRegistry.this.lock.lock();
|
||||
try {
|
||||
if (!(RedisLockRegistry.this.isRunningRedisMessageListenerContainer
|
||||
&& RedisLockRegistry.this.redisMessageListenerContainer != null
|
||||
|
||||
Reference in New Issue
Block a user