From f1369a5b281bafeafa649a8141d513767251f776 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Sun, 12 Apr 2026 19:13:49 -0700 Subject: [PATCH] docs(pegboard-runner): explain alloc idx eviction invariant --- engine/packages/pegboard-runner/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/packages/pegboard-runner/src/lib.rs b/engine/packages/pegboard-runner/src/lib.rs index fcd7a7f649..76372dcea5 100644 --- a/engine/packages/pegboard-runner/src/lib.rs +++ b/engine/packages/pegboard-runner/src/lib.rs @@ -240,6 +240,8 @@ impl CustomServeTrait for PegboardRunnerWsCustomServe { } // Clear alloc idx if not evicted else { + // Eviction implies the replacement connection reused the same runner_id and already + // rewrote the alloc idx, so clearing here would race the new connection. // Make runner immediately ineligible when it disconnects let update_alloc_res = self .ctx