Intent-Code Divergence
Medium
- Confidence
- 99% confidence
- Finding
- The distributed lock is unsafe because it stores a constant value and releases the lock by blindly deleting the Redis key, without verifying that the caller still owns it. If the lock expires and is reacquired by another worker, a stale owner can delete the new owner's lock, breaking mutual exclusion and enabling race conditions, data corruption, or concurrent execution of critical sections.
