Who gets the last pair?

Advance a race between two checkout workers. Both use token-safe unlock. Compare what happens when the database also checks available stock.

Before advancing, predict whether both customers can receive a confirmation. Changing a setting resets the run.

Simulated time
Redis lease holder
Database stock
Reservations confirmed

Race trace (newest first)

    Check your understanding

    When A resumes, what does comparing tokens during unlock protect?

    Conceptual model of one inventory row. The atomic check protects the stock count. Request idempotency and downstream fencing address separate failures.