背景
今天在生产环境中碰到了这个问题,Lock was released in the store due to expiration. The integrity of data protected by this lock may have been compromised.
分析
查看报错来源,是来自于org.springframework.integration.redis.util.RedisLockRegistry
的内部类 RedisLock的 unlock 方法。
@Override
public void unlock() {
if (!this.localLock.isHeldByCurrentThread()) {
throw new IllegalStateException("You do not own lock at " + this.lockKey);