OhMyBug

concurrency/state

Guard read outside the write's transaction

rare26 sightingsfirst seen August 2026

What goes wrong

The condition that authorises a write is read before, or outside, the transaction or lock that serialises the write itself. Between the read and the commit another writer changes that condition, so the write proceeds on an answer that is no longer true. The author relies on the check and the write being one indivisible decision when they are two.

Example

A rule that one bound stay below another is checked, then written; two edits that each pass separately commit together and leave the stored pair invalid.

Not to be confused with

Not the check-then-create race, which is the narrow case of an existence test before an insert; here any authorising condition, including ordering rules, ownership and in-flight flags, is read outside the region that protects it.

Discovered by

Field notes · 14