0

I need your help to understand the redis-distributed-lock behaviour in case of redis-server restart.

According to this redis doc: "lockWatchdogTimeout prevents against infinity locked locks due to Redisson client crash or any other reason when lock can't be released in proper way."

Based on this doc we used redis lock without leaseTime and with lockWatchdogTimeout(5sec) but when redis-server was being restarted (and not available for few sec), the client(java-redisson-lib) was unable to unlock the lock(when unlock() method executed server was unavailable and threw connection error as it was being restarted) and because the lock was not released, and because we specified lockWatchdogTimeout, the redisson-client kept on updating(renewing) the expiry-date for that lock and thus the lock went into infinity locking state and we had to restart the client-process to stop the redisson-client renewing that lock. To avoid such cases in future we switched from lockWatchdogTimeout to leaseTime. This makes us think that leaseTime is more reliable than lockWatchdogTimeout which is not true as per the docs. What is your opinion on this. Is there a way for redisson-client to handle such cases.

Ankush G
  • 989
  • 9
  • 14

0 Answers0