-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Description
Expected behavior
After a Redis response timeout, Redisson needs to be resilient and back to normal operation after Redis timeout and allow to lock and unlock critical sections again.
Actual behavior
After a Redis response timeout between attempts, Redisson adds the lock to scheduled renew task and never remove them. So, the application enters on a deadlock due to a lock renewed even after unlock.
The task can run on the same thread due to reentrant lock feature, but when the task runs on another thread a deadlock occurs.
Steps to reproduce or test case
- Start Redis
- Run the test application (https://github.com/hmagarotto/redissonlock) with a simple locked task.
- Force a timeout on Redis runnning a client pause command: "CLIENT PAUSE 5000"
Redis version
4.0.10
Redisson version
3.10.3
Redisson configuration
Single server default
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
Select code repository
Activity
mrniko commentedon Mar 11, 2019
Unable to reproduce. In this case lock is expired automatically by this method
redisson/redisson/src/main/java/org/redisson/RedissonLock.java
Line 258 in 1d33ebd
Config.lockWatchdogTimeout
setting.hmagarotto commentedon Mar 11, 2019
Hi, thanks for your support.
In the above scenario Redisson continues to renew the TTL every 10 seconds, so the lock never expires or is removed. I will try to demonstrate better how to reproduce...
hmagarotto commentedon Mar 11, 2019
Terminal session with test case:
https://gitcdn.link/repo/hmagarotto/8c3a4b51422e45a75f77f17d9298bbd1/raw/3dc65728fa2d79b326967f30b9a6e5be0db70acb/redisson-lock-test-term-session.svg
recorded with termtosvg
aawu commentedon Mar 12, 2019
same problem here #1950
Fixed - locked lock isn't unlocked after disconnect to Redis #1966
mrniko commentedon Mar 13, 2019
Fixed! Please find updated jar below
redisson-3.10.5-SNAPSHOT.jar.zip
aawu commentedon Mar 13, 2019
thanks for your support :)
hmagarotto commentedon Mar 13, 2019
Thanks!
Now the lock is being removed by the Redis TTL after time expired.
danielshama commentedon Mar 3, 2024
Hi, I still have the same issue with version 3.17.4. I'm using tryLock with RReadWriteLock. After a timeout, I notice that Redisson continues to renew the TTL for the same lock.
mrniko commentedon Dec 30, 2024
@danielshama
Please upgrade to 3.38.1 or higher. Let us know if it happens with this version.