Skip to content

Commit

Permalink
GH-9401: RedisLockRegistry: use lock() instead of tryLock() for l…
Browse files Browse the repository at this point in the history
…ifecycle

Fixes: #9401

Switched `tryLock()` with `lock()` in `RedisLockRegistry.runRedisMessageListenerContainer()` method for correct synchronization.

**Auto-cherry-pick to `6.3.x` & `6.2.x`**
  • Loading branch information
alexpeelman authored Aug 20, 2024
1 parent feef055 commit 07085a1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
* @author Eddie Cho
* @author Myeonghyeon Lee
* @author Roman Zabaluev
* @author Alex Peelman
*
* @since 4.0
*
Expand Down Expand Up @@ -658,7 +659,7 @@ private boolean subscribeLock(long time) throws ExecutionException, InterruptedE
}

private void runRedisMessageListenerContainer() {
RedisLockRegistry.this.lock.tryLock();
RedisLockRegistry.this.lock.lock();
try {
if (!(RedisLockRegistry.this.isRunningRedisMessageListenerContainer
&& RedisLockRegistry.this.redisMessageListenerContainer != null
Expand Down

0 comments on commit 07085a1

Please sign in to comment.