Relationships
#5033 serve: a verify-on-enroll pass can promote a worker that started draining while its verify_passed write queued
Opened by stack72 · 11/23/2026
WorkerGateway #runEnrollmentVerify checks entry.status !== draining before it queues the verify_passed write, then sets entry.status to idle inside that write without checking again. A drain that arrives after the check but before the queued write runs is overwritten in memory: the durable record says draining, while the pool reports the worker idle and the scheduler can dispatch to it. Found by the adversarial review of swamp-club#3988 (which moved this write to the worker's key of the gateway tail); the gap existed on the shared chain too. Fix direction: re-check draining inside the write and skip the promotion and the onWorkerEnrolled and onWorkerIdle callbacks when it is draining. A test needs another write held on the worker's key while the probe passes and the drain arrives.
Open
No activity in this phase yet.
Sign in to post a ripple.