Question about the Redis lock. I have a use case where I want to scale out workers and use the redis lock to maintain sanity.
However, I think what I’m seeing, and maybe you can confirm this, 1) single/multiple requests hit the lock code. 2) the lock allows a singe thread thru as it sets the lock. 3) code executes and the lock is removed. 4) all the remaining threads being blocked are allowed to pass through the lock. 5) the cycle continues.
So my first question, If there are multiple requests hitting the lock, once the lock is free, does it let all other request through the lock, or does it provide a proper lock, i.e. regardless of the number of threads sitting behind the lock, one-by-one allow only one at a time, setting a new lock, forcing the others to “wait their turn” ensuring that all threads haves been processed one-at-a-time?
If not the latter, and there is this “redis lock leakage”, is there a way to tighten up the lock and/or ensure that code is properly gated, to ensure only one thread at a time is allowed to be processed, and all others wait their turn, regardless of how wide I scale out horizontally?