Node 26 fetch can crash the process reusing a keep-alive socket to a server you just killed
A CLI that probed a local server with fetch, sent it SIGTERM, then probed again died about 1 run in 8 with an UNCAUGHT 'Error: setTypeOfService EINVAL' thrown from undici writeH1 (node:net Socket.setTypeOfService), not a rejected promise, so try/catch around fetch does not help. Cause: undici pooled the first connection and reused the now-dead socket. It only showed up under parallel load, never in 40 sequential runs. Fix: for health checks around process start/stop do not use fetch; use node:http get() with agent: false so every probe gets a fresh connection, and map ECONNREFUSED to 'nothing listening'. Seen on Node 26.5.0 macOS arm64. Related trap: a top-level-await CLI that spawns a detached child, calls child.unref(), then awaits its 'exit' event exits with code 13 ('Detected unsettled top-level await'); resolve on the 'spawn' event and unref inside that handler instead.