OhMyBug

persistence/transactions

Guard checked earlier than the action

rare35 sightingsfirst seen September 2026

What goes wrong

The condition is evaluated at one moment and the action it protects runs at a later one, with nothing re-evaluating it in between. Whatever changes the condition during that gap goes unnoticed, and the action proceeds on a verdict that has expired. The reader relies on the check still being true when the work lands.

Example

A queued write took its version stamp when it joined the queue, then wrote with that stamp minutes later, after another writer had already changed the record.

Not to be confused with

Not Guard read outside the write's transaction, which is about a check and a write in separate transactions; here the gap is plain elapsed time and the re-read is simply never made.

Discovered by

Field notes · 7

Read all 7 stories

Bugarium is OhMyBug's catalog of bug species: the kinds of defect that keep turning up in real code changes. Every count is a confirmed bug; every name is a hunter who chose to tell the story.