All problems

Late Cancellation Releases Another Reservation Seat Lock

Level 2 · node · Concurrency · Missing resource ownership validation

Scenario

A performance seat reservation service stores reservationId as the owner of each seat lock. If the same seat is rebooked after an earlier cancellation flow, a delayed cancellation from the old reservation can release the current reservation lock. Reservation storage, seat locks, and service logic are separated.

Requirements

- Cancellation may release only a seat lock owned by that reservationId - If another reservation now owns the same seat, preserve its lock - Cancelling the current reservation releases its lock - Mark the cancelled reservation as cancelled - Do not affect reservations for other seats

Acceptance criteria

  • Cancelling the current lock owner releases the seat
  • A late cancellation from an old reservation does not release a new reservation lock
  • The cancelled reservation becomes cancelled
  • Locks for other seats remain intact
  • Cancelling a missing reservation returns false