Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Exception when use unlock the lock in the same object In cluster mode. did it work correct ? #5853

Closed
angel-wong opened this issue May 9, 2024 · 1 comment

Comments

@angel-wong
Copy link

like

 RLock lock = redissonClient.getLock(key);
 lock.lock();
try {
    // do somethings
}  finally {
    lock.unlock();  // Exception
}

this will get exception when unlock;

but use redissonClient.getLock(key).unlock(); will fine

@angel-wong
Copy link
Author

Exception is

org.redisson.client.RedisException: CROSSSLOT Keys in request don't hash to the same slot. channel: [id: 0x2a175254,.....] command: (EVAL), promise: java.util.concurrent.CompletableFuture@50e1ce72[Not completed], params: [local val = redis.call('get', KEYS[3]); if val ~= false then return tonumber(val);end; if (redis.call('hexists', KEYS[1], ARGV[3]) == 0) then return nil;end; local counter = redis.call('hincrby', KEYS[1], ARGV[3], -1); if (counter > 0) then redis.call('pexpire', KEYS[1], ARGV[2]); redis.call('set', KEYS[3], 0, 'px', ARGV[5]); return 0; else redis.call('del', KEYS[1]); redis.call(ARGV[4], KEYS[2], ARGV[1]); redis.call('set', KEYS[3], 1, 'px', ARGV[5]); return 1; end; , 3, XXXXXXXXXXXX, redisson_lock__channel:XXXXXXXXXXXX, redisson_unlock_latch:XXXXXXXXXXXX:0798c7a37e5c4709558602c60ca8bf2a, 0, 30000, bdef00f6-6954-4a59-ab1b-c64ce2635e23:187, PUBLISH, 13500]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant