redis server version=3.2.10&redisson version在此方法中为'3.2.1',在调用lock.unlock()时,出现以下异常。
方法
public void unlock(String key) throws TPException {
log.info("Attempting to relinquish lock on {}", key);
RLock lock = redissonClient.getFairLock(key);
System.out.println(lock != null && lock.isLocked() && lock.isHeldByCurrentThread());
if (lock != null && lock.isLocked() && lock.isHeldByCurrentThread())
lock.unlock();
else throw new TPException(String.format("Failed to unlock %s", key));
log.info("Succeeded to relinquish lock on {}", key);
}
例外
07-Jul-2020 00:56:19.573 SEVERE [http-nio-8082-exec-4] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [dispatcher] in context with path [/bpjobs] threw exception
[Request processing failed; nested exception is org.redisson.client.RedisException: ERR Error running script (call to f_51d3c567a1bad9117bc42c349c0ceac3b79447f0):
@user_script:1: @user_script: 1: Unknown Redis command called from Lua script . channel: [id: 0x52a590e3, L:/192.169.44.159:55740 - R:/10.64.95.26:6378]
command: CommandData [promise=org.redisson.misc.RedissonPromise@5e7735b[Not completed], command=(EVAL), params=[while true do local firstThreadId2 = redis.call('lindex', KEYS[2], 0);if firstThreadId2 == false the..., 4, 6, redisson_lock_queue:{6},
redisson_lock_timeout:{6}, redisson_lock__channel:{6}, 0, 30000, d24e0e02-2de3-428c-98f8-b336022954c6:34, 1594063579312], codec=org.redisson.client.codec.LongCodec@5e719eca]] with root cause```
请建议任何解决方案,我不能升级redis版本&更改redisson版本也不起作用。我在5.0.9版本的本地redis服务器上进行了尝试,结果一切正常。
暂无答案!
目前还没有任何答案,快来回答吧!