Event-order race

Concurrency, Async & Events

Last updated: November 10, 2025

Overview

Bug Type:
Event-order race
Category:
Concurrency, Async & Events

Definition

Logic assumes a specific order of asynchronous events; alternate orderings break invariants (TOCTOU).

How to fix Event-order race?

Combine check-and-use atomically; use optimistic concurrency with retries; serialize critical steps; verify ordering guarantees

Symptoms

Observable signs that may indicate Event-order race:

  • Check-then-act logic fails when state changes between operations.
  • Validation passes but subsequent use sees different state.
  • Time-of-check/time-of-use windows exploited in tests.

Example Errors:

  • Precondition failed due to state change
  • Resource modified since validation
  • TOCTOU violation

© 2025 peqy.ai · Bug Taxonomy