OhMyBug

concurrency/state

Cleanup on one exit path only

rare15 sightingsfirst seen September 2026

What goes wrong

The release, unlock, or done-marker sits on a single route out of a block, normally the successful one. Every other way out - an early return, a thrown error, an abandoned wait - leaves the resource held or the record unwritten. The reader relies on a step being reached simply because it is written last.

Example

A worker clears its lock at the end of the successful path, so when a validation check returns early the lock stays set and the item is never picked up again.

Not to be confused with

Not Busy Flag Cleared Only On Success, which is about one named flag after a failure; this covers any finalising step that an alternative exit bypasses, including early returns taken deliberately.

Discovered by

Field notes · 7