diff options
| author | historia <[not public]> | 2026-09-18 15:16:44 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 15:16:44 -0400 |
| commit | 7eab582d8a8ee2af1a6baae7baf0696c7005de2e (patch) | |
| tree | 902bbc8c6e39c9f62f779ca23267714ec420b9f5 /building_guide/concurrency.md | |
| parent | 153acb7f644d755c45533b7c5311e3ffa47e8973 (diff) | |
| download | thehouseoficarus-7eab582d8a8ee2af1a6baae7baf0696c7005de2e.tar.gz | |
fix: harden triggers, economy, casino, world data, and admin/net paths
Diffstat (limited to 'building_guide/concurrency.md')
| -rw-r--r-- | building_guide/concurrency.md | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/building_guide/concurrency.md b/building_guide/concurrency.md index a30e1a6..74bbdc7 100644 --- a/building_guide/concurrency.md +++ b/building_guide/concurrency.md @@ -22,8 +22,13 @@ Rules: - A FULL task queue applies backpressure: submitters block until the owner drains a task, and a full queue never bypasses the owner — running a task on the caller's goroutine while the owner keeps executing would break the - single-owner invariant. Only a STOPPED owner (graceful shutdown, after - admissions have closed) lets stragglers execute inline. + single-owner invariant. A STOPPED owner (graceful shutdown, after + admissions have closed) refuses the task and drops it rather than running + it on the caller's goroutine: `RunOnOwner` returns without executing the + closure, because running it there would mutate live state concurrently + with the shutdown sequence and after the final-save barrier. (Synthetic + tests that construct a Game without an owner run tasks inline on the + caller.) - Code already running on the owner must NOT call `Game.RunOnOwner` — it would deadlock waiting for itself. Owner-executed code calls functions directly. @@ -171,7 +176,10 @@ At startup (`game.New`), open records are compensated in two phases: pre-payout balance → re-apply (the player is owed it); at the post-payout balance → already durable, settle; anything else stays open and is surfaced for operator inspection — a liability is never silently - dropped. + dropped. Payouts written by current code are **Tracked**: the record ID + is stored in the character file's `open_payouts` evidence list, and + recovery proves durability from that evidence rather than from the + balance checkpoints (which remain only as a legacy fallback). 2. Open **wager** records (newest first, so each refund restores the balance the previous record's checkpoints refer to): file at the pre-debit state (credits AND chips) → void (nothing was charged); at |
