astyanax
astyanax copied to clipboard
Fixing weird Deadlock problem when 2 request arrive at the same time
As commented before, fixing an issue that happens when 2 request arrive at the exact same microsecond an we use a RetryPolicy other than RetryOnce, this causes a BusyLockException for both threads causing deadlock.
What about if someone sets the lock id? In that case the lock id's aren't unique.
Also, in the scenario you outline when the 2 requests arrive at the same time and get a BusyLockException, wouldn't the next time verifyLock is called be with a different curTimeInMicros argument so the race condition would not occur?