Skip to content

Commit 7b11d65

Browse files
committed
Clarify that only make() errors are logged as error status
Duplicate key errors from collisions occur outside make() and are handled silently - the job reverts to pending or (none) state. Only genuine computation failures inside make() are logged with error status.
1 parent 61cc759 commit 7b11d65

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/src/design/autopopulate-2.0-spec.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,13 @@ When two workers attempt to populate the same key:
431431
1. Both call `make()` for the same key
432432
2. First worker's `make()` transaction commits, inserting the result
433433
3. Second worker's `make()` transaction fails with duplicate key error
434-
4. Second worker catches the error and moves to the next job
434+
4. Second worker catches the error, and the job returns to `pending` or `(none)` state
435+
436+
**Important**: Only errors that occur *inside* `make()` are logged with `error` status. Duplicate key errors from collisions occur outside the `make()` logic and are handled silently—the job is either retried or reverts to `pending`/`(none)`. This distinction ensures the error log contains only genuine computation failures, not coordination artifacts.
435437

436438
**Why this is acceptable**:
437439
- The `make()` transaction guarantees data integrity
438-
- Duplicate key error is a clean, expected signal
440+
- Duplicate key error is a clean, expected signal (not a real error)
439441
- With `reserve_jobs=True`, conflicts are rare (requires near-simultaneous reservation)
440442
- Wasted computation is minimal compared to locking complexity
441443

0 commit comments

Comments
 (0)