GH-9401: RedisLockRegistry: use lock() instead of tryLock() for lifecycle
Fixes: #9401 Switched `tryLock()` with `lock()` in `RedisLockRegistry.runRedisMessageListenerContainer()` method for correct synchronization. **Auto-cherry-pick to `6.3.x` & `6.2.x`**
This commit is contained in:
@@ -87,6 +87,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