RedLock.net icon indicating copy to clipboard operation
RedLock.net copied to clipboard

Auto extend is not stopped event when getting conflict as a result

Open mennyst opened this issue 7 years ago • 2 comments

Hey,

I saw your implementation and i am concerned from some scenarios.

  1. 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?
  2. 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
  3. 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?

mennyst avatar Dec 06 '18 11:12 mennyst

Any update? This issue concerns me as well. Some event triggered on State change would be useful.

Crozin avatar Apr 15 '19 11:04 Crozin

Over a long enough period of time could this cause resource exhaustion? (Memory leak/network connections etc?)

TomGullen avatar Mar 13 '20 16:03 TomGullen