Here are the lock scripts of read lock and write lock in Redisson.
As we can see from the script, if read lock is reentrant and lock again, the expire time of the lock will be reset to the leaseTime
. On the opposite, the expire time of write lock will plus the leaseTime
when lock again.
Why do read locks and write locks handle expiration time differently? What is the reason for doing this?
Thank you so much.