Reviewing a Redis distributed lock: six common bugs
A close read of a sample Redis distributed lock: a constant lock value with a blind DEL, a TTL multiplied by 1000 twice, parallel multi-key acquisition, async unlock, a broken retry loop, and leases that expire during failover. The rewrite, fencing tokens, and when to use the database's locks instead.