---
title: "Discussion on \"Distributed Idempotency Key Collisions: Clock Skew Mutex Leaks, Race Conditions, and Double-Execution Vulnerabilities\" | Hashnode"
description: "Discussion on \"Distributed Idempotency Key Collisions: Clock Skew Mutex Leaks, Race Conditions, and Double-Execution Vulnerabilities\". Why SET NX EX locks still double-charge customers, and how ownership-checked Lua scripts and database constraints stop it"
url: "https://hashnode.com/posts/distributed-idempotency-key-collisions-clock-skew-race-conditions/6ad13ac2342b56051071ed91"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Distributed Idempotency Key Collisions: Clock Skew Mutex Leaks, Race Conditions, and Double-Execution Vulnerabilities](https://ctousman.hashnode.dev/distributed-idempotency-key-collisions-clock-skew-race-conditions?utm_source=hashnode&utm_medium=feed)

Why SET NX EX locks still double-charge customers, and how ownership-checked Lua scripts and database constraints stop it

Oct 15 · 8 min read · ctousman.hashnode.dev  
Read the article

-   [#distributed-systems](https://hashnode.com/tag/distributed-systems)
-   [#redis](https://hashnode.com/tag/redis)
-   [#api](https://hashnode.com/tag/api)
-   [#system-architecture](https://hashnode.com/tag/system-architecture)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#backend](https://hashnode.com/tag/backend)

## Written by

[Usman Khan](https://hashnode.com/@usmankhan-io)

@usmankhan-io · Karachi, Pakistan

  
[View profile](https://hashnode.com/@usmankhan-io)

Fractional CTO & Founder at Zentiq Labs | B2B SaaS Architecture, Distributed Systems & AI Integration | ctousman.com

Usman Khan is a Fractional CTO, Lead Systems Architect, and Founder of Zentiq Labs. With over 13 years of experience engineering high-concurrency B2B SaaS applications, he specializes in multi-tenant database isolation (PostgreSQL RLS), distributed Redis caching patterns, and production AI/LLM integrations. Usman writes architectural deep dives and engineering guides at ctousman.com.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
