Race Condition
A defect whose occurrence depends on the relative timing of concurrent operations.
A race condition occurs when the correctness of a result depends on the order in which concurrent operations happen to complete. Races are the archetypal intermittent bug: they reproduce on slow machines and vanish on fast ones, or the reverse. They are also the classic Heisenbug, since a print statement or a breakpoint shifts the timing enough to close the window the fault needed, and the bug disappears exactly when someone looks at it.
The web platform generates a particular family of them. A build tool's dependency scan finishing mid-run triggers a page reload that aborts whatever was in flight — so a random file fails, never the same one twice, and never on a fast local machine that wins the race every time. A resize observer's first callback lands a frame or two after mount, too late to prevent a visible jump and early enough to fight a user who has already scrolled. A framework re-rendering a subtree that a browser mutated directly diffs against a stale model.
Concurrent processes race in the same way over shared resources: two test runs in one working copy destroying each other's temporary files, two workers deriving the same port, two agents editing one directory.
The general remedies are to remove the shared resource (separate working copies, unique filenames), to make the ordering explicit (wait on an observable condition, not a duration), or to make the operation idempotent so order stops mattering. See Idempotence.
See also11
Flaky Test
A test that passes and fails on identical input, and the most corrosive thing a suite can contain.
Testing & Verification30 connections
Multi-Agent Orchestration
Coordinating several model instances on one body of work, each with its own context.
Agents & Language Models11 connections
Git Worktree
An additional working directory attached to one repository, each on its own branch.
Version Control & Delivery15 connections
Determinism
The property that identical inputs produce identical outputs, and the foundation of caching and verification.
Systems & Tooling61 connections
Bundler
The tool that resolves an application's modules into the files a browser downloads.
Web Platform18 connections
Reproducible Case
The smallest set of steps that reliably produces a fault, and the unit of real debugging.
Method27 connections
Fan-Out and Fan-In
Splitting work across parallel workers and recombining their results.
Agents & Language Models11 connections
Ground Truth
The measurement that arbitrates, as opposed to the artifact that merely reports.
Method99 connections
Token Budget
The finite allowance of model usage a task may consume, and the design decisions it forces.
Agents & Language Models20 connections
Time-of-Check to Time-of-Use
A race where a program checks a condition and then acts on it, but the world changes in between, the root of classic file-permission exploits and of double-spending bugs in web applications.
Systems & Tooling12 connections
Futex
The Linux primitive that makes locks cheap by handling the uncontended case entirely in user space and asking the kernel for help only when a thread actually has to wait, the foundation under most thread libraries.
Systems & Tooling8 connections
Linked from34
- Actor ModelComputation & Algorithms
A concurrency model where isolated actors communicate only by asynchronous message, never by shared memory.
- Battle RoyalePlay & Games
A many-player elimination format that uses a shrinking play area to force an ending the players would otherwise avoid.
- BundlerWeb Platform
The tool that resolves an application's modules into the files a browser downloads.
- Circuit BreakerNetworks & Distribution
A circuit breaker stops calling a failing dependency, converting slow repeated failures into a fast, cheap one.
- Concurrency and ParallelismComputation & Algorithms
Concurrency is structuring independent tasks together; parallelism is actually running them at the same instant.
- Core DumpSystems & Tooling
A snapshot of a crashed program's memory saved for later inspection, how to get one, how to read one, and why it can leak secrets.
- Database ConstraintData & Content
Rules declared in the schema that the database itself enforces on every write, such as uniqueness, required values, and allowed ranges, so bad data is refused at the door rather than cleaned up later.
- DeadlockComputation & Algorithms
When two or more processes each wait for something another holds, so none can ever proceed, and the four conditions that must all be true for it to happen.
- Event LoopComputation & Algorithms
A single-threaded runtime's mechanism for pulling the next callback off a queue once the call stack is empty.
- Fan-Out and Fan-InAgents & Language Models
Splitting work across parallel workers and recombining their results.
- Flaky TestTesting & Verification
A test that passes and fails on identical input, and the most corrosive thing a suite can contain.
- Foreign KeyData & Content
A column that points at a row in another table, with the database refusing any change that would leave the pointer dangling.
- FutexSystems & Tooling
The Linux primitive that makes locks cheap by handling the uncontended case entirely in user space and asking the kernel for help only when a thread actually has to wait, the foundation under most thread libraries.
- Git WorktreeVersion Control & Delivery
An additional working directory attached to one repository, each on its own branch.
- HeisenbugTesting & Verification
A fault that changes or disappears when someone tries to observe it.
- IdempotenceSystems & Tooling
The property that performing an operation twice has the same effect as performing it once.
- Immersive SimPlay & Games
A design tradition that simulates consistent rules rather than scripting outcomes, so solutions the designer never planned still work.
- ImmutabilityComputation & Algorithms
A value that cannot change after construction, so sharing it never risks a caller seeing another caller's edit.
- Isolation LevelData & Content
How much concurrent transactions are allowed to see of each other's unfinished work, a dial between correctness and speed that most databases set lower than people assume.
- Lock-Free Data StructureComputation & Algorithms
Concurrent data structures built on atomic hardware instructions instead of locks, so a stalled thread can never block the others, at the price of some of the hardest code in computing.
- Minimal Reproducible ExampleTesting & Verification
The smallest self-contained program or set of steps that still shows a bug, and why making one is often the moment the bug gets understood.
- Multi-Agent OrchestrationAgents & Language Models
Coordinating several model instances on one body of work, each with its own context.
- Optimistic LockingData & Content
Letting concurrent writers proceed unchecked and catching conflicts only at commit time, betting that collisions are rare.
- Persistent Data StructureComputation & Algorithms
Data structures that preserve every previous version when changed, sharing unchanged parts between versions so "copying" is cheap.
- Pessimistic LockingData & Content
Blocking every other writer up front for the duration of a transaction, betting that collisions are common enough to prevent rather than clean up.
- PromiseWeb Platform
JavaScript's object for a value that will arrive later, how it replaced nested callbacks, and the microtask queue that decides when its handlers run.
- Reproducible CaseMethod
The smallest set of steps that reliably produces a fault, and the unit of real debugging.
- Server-Side Request ForgeryWeb Platform
Tricking a server into making requests on an attacker's behalf, reaching internal services and cloud credential endpoints that the attacker could never reach directly, behind some of the largest cloud breaches.
- Static AnalysisTesting & Verification
Finding bugs by examining code without running it, from linters and type checkers to deep security analysis, always trading missed bugs against false alarms.
- SubagentAgents & Language Models
A model instance spawned by another to handle a scoped task with its own context.
- Time-of-Check to Time-of-UseSystems & Tooling
A race where a program checks a condition and then acts on it, but the world changes in between, the root of classic file-permission exploits and of double-spending bugs in web applications.
- Token BudgetAgents & Language Models
The finite allowance of model usage a task may consume, and the design decisions it forces.
- UpsertData & Content
Inserting a row if it doesn't exist and updating it if it does, in one atomic statement, which is harder than it sounds because the obvious check-then-insert version races with itself.
- WebhookNetworks & Distribution
A webhook is an HTTP callback a service pushes to you when an event happens, inverting who initiates the request.