shawn8888 found it (#1227): server() probed the port, saw this plugin's
marker and returned {} for good. During a host swap the old host is
still serving, so the new one never started, and once the old one
exited nothing served 3492 and the scheduler stopped until the next
swap. The old host also holds service.lock, so retrying the bind alone
would have come up read-only (lockedBy) with no scheduler.
Now server() returns {} at once and, once per port, checks every second
in the background: while the marker answers it waits; when it stops it
runs the whole start (migrate, lock, bind, scheduler), and an
EADDRINUSE from a port not let go yet is tried again the next second.
The data directory is the one the call resolved. A port held by
something without the marker still throws, as before.
Run (mote, HOME=$(mktemp -d)):
- bun test in packages/window-warmup: 280 pass, 0 fail.
- tsc --noEmit: ok. bun scripts/check.mjs window-warmup: ok.
- dist rebuilt with bun scripts/build.ts; dist.test passes.
Broken by hand: origin/main's src/plugin.ts with the new tests: both
fail (marker stops, real old service holding port and lock stops).
Not tried: a real magpie host swap.