RedLock.net
RedLock.net copied to clipboard
Auto extend is not stopped event when getting conflict as a result
Hey,
I saw your implementation and i am concerned from some scenarios.
- When the auto extend timer gets to starvation from any reason and then when the timer is released another process locks the same key, then the extend gets to conflict but it still tries to acquire the lock on the next interval and might succeed so the client (code) will never know that someone else took hold of the key in the mean time?
- Same as the first only the extend only tries to acquire the key after the second process takes hold and already release the key, so we don't event know there was a conflict
- My suggestion to overcome this issue is to only try and auto extend the lock in between expiry / 2 until expiry, so the key can't be extended if the key already expired
What do you think?
Any update? This issue concerns me as well. Some event triggered on State change would be useful.
Over a long enough period of time could this cause resource exhaustion? (Memory leak/network connections etc?)