Yes. In a distributed system, there's a possibility of this happening. That's why it is good as a best practice to implement a robust exception handling technique to gracefully cater for this. Including an efficient retry mechanism to serialize the conflicting threads.
But generally, and even in a distributed system, the possibility is almost zero. Considering that the redis SETNX operation used to acquire the lock is atomic.
Adewole Caleb Erioluwa
Code -> Play guitar -> Draw -> Play -> Sing -> Repeat
What is your take on the possibility of acquisition of redis locks by different thread at the same time?. Is there a likelihood of that happening?