Skip to content

Commit 797dec1

Browse files
committed
fix(relay): keep post-cancel drain timer ref'd so silent bounds fire
An unref'd setTimeout never woke Bun's pending reader.read on Windows, so the silent time-bound inspection drain hung CI until the 20m job cancel.
1 parent 6b97879 commit 797dec1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/server/relay.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,10 @@ function startBoundedInspectionPump(options: InspectionPumpOptions): void {
854854
stopDrain();
855855
return;
856856
}
857+
// Do not unref: on Bun/Windows a pending `reader.read()` can be the only
858+
// wake source; an unref'd timer may never run, so a silent post-cancel
859+
// drain (time bound, no bytes) hangs the suite until the job timeout.
857860
drainTimer = setTimeout(stopDrain, drainMs);
858-
(drainTimer as { unref?: () => void }).unref?.();
859861
};
860862
// Ends the bounded drain by cancelling the reader: the pending read settles
861863
// and the pump loop observes `drainStopped`. Deliberately NOT a shared

0 commit comments

Comments
 (0)