2323import java .util .ConcurrentModificationException ;
2424import java .util .Date ;
2525import java .util .LinkedHashMap ;
26+ import java .util .List ;
2627import java .util .Map ;
2728import java .util .Map .Entry ;
2829import java .util .UUID ;
@@ -668,7 +669,7 @@ private final class RedisPubSubLock extends RedisLock {
668669 private static final String UNLINK_UNLOCK_SCRIPT = """
669670 local lockClientId = redis.call('GET', KEYS[1])
670671 if (lockClientId == ARGV[1] and redis.call('UNLINK', KEYS[1]) == 1) then
671- redis.call('PUBLISH', ARGV [2], KEYS[1])
672+ redis.call('PUBLISH', KEYS [2], KEYS[1])
672673 return true
673674 end
674675 return false
@@ -689,9 +690,10 @@ protected boolean tryRedisLockInner(long time, long expireAfter)
689690
690691 @ Override
691692 protected boolean removeLockKeyInnerUnlink () {
693+ final String unLockChannelKey = RedisLockRegistry .this .unLockChannelKey + ":" + this .lockKey ;
692694 return Boolean .TRUE .equals (RedisLockRegistry .this .redisTemplate .execute (
693- UNLINK_UNLOCK_REDIS_SCRIPT , Collections . singletonList (this .lockKey ),
694- RedisLockRegistry .this .clientId , RedisLockRegistry . this . unLockChannelKey + ":" + this . lockKey ));
695+ UNLINK_UNLOCK_REDIS_SCRIPT , List . of (this .lockKey , unLockChannelKey ),
696+ RedisLockRegistry .this .clientId ));
695697 }
696698
697699 private boolean subscribeLock (long time , long expireAfter ) throws ExecutionException , InterruptedException {
0 commit comments