--- id: 9b70e3d5-d0b6-48c5-88d0-2fbc36f4fd4d type: problem title: "Play lock never released on exception - causes permanent user lockout" tags: [paper-dynasty, python, discord-bot, sqlalchemy, concurrency, critical-bug, play-lock, database] importance: 0.95 confidence: 0.8 created: "2026-02-04T15:02:48.444623+00:00" updated: "2026-02-04T15:02:48.444623+00:00" relations: - target: 5d8e1ff5-3354-4cfa-ab63-bf96b5ce1e01 type: SOLVES direction: outgoing strength: 0.5 - target: 638ac861-2c7b-462c-9d82-672e4536688e type: REQUIRES direction: outgoing strength: 0.5 --- The play locking system in checks_log_interaction() sets play.locked=True and commits it (logic_gameplay.py:1262-1264), but if an exception occurs during command processing, the lock is NEVER released. The only unlock is in complete_play() (line 1015) which only runs on successful completion. This caused 13 plays to be permanently locked across multiple games, completely blocking users. Production incident on 2026-02-04: play 103546 in game 1346 was stuck locked, blocking active user. Error message claims 'auto-unlock will trigger' but that functionality doesn't exist. Root cause: no try/finally block or exception handling to release lock on failure. Manual fix: UPDATE play SET locked=false WHERE locked=true AND complete=false.