[GH-ISSUE #8948] [Issue]: a pending notices DNS lookup delays Restart Server and shutdown on a stalled resolver #8903

Closed
opened 2026-11-07 22:46:26 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @SpicyMarinara on GitHub (Nov 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8948

Originally assigned to: @SpicyMarinara on GitHub.

Summary

While the notices fetch's DNS lookup for raw.githubusercontent.com is pending, the server can't exit until the lookup returns, and a stalled system resolver can hold that for about 30 s. Affected:

  • the in-app Restart Server (admin.routes.ts, process.exit(75));
  • signal shutdown;
  • the force-exit fallback (armShutdownDeadline).

Details

  • notices.routes.ts fetches the notices URL at startup and hourly. Node resolves the host with getaddrinfo on the libuv threadpool, and process.exit() waits for pending threadpool work.
  • Probe with the same call shape (fetch(url, { redirect: "error", signal: AbortSignal.timeout(10_000) }), then process.exit(75) 200 ms later): with a working resolver the process is gone in 0.25 s; with a 15 s simulated lookup stall it's gone only after 15.28 s.
  • This is what broke the restart-supervisor and signal-shutdown CI lanes in #8947: the old server exited ~29 s after process.exit, past the supervisor's window. The tests now turn notices off (#8947's PR), but users with a slow or stalled resolver still see a stalled restart. A launcher Ctrl+C then ends with a SIGKILL after 10 s and exit code 137.
  • Saved data is safe: storage is flushed in app.close() before the exit.

Expected

A pending notices lookup never delays the process exiting. For example, resolve the notices host with dns.resolve4/resolve6 (c-ares, off the threadpool) through a custom lookup on the fetch dispatcher, keeping redirect: "error" and the 10 s timeout. Add a regression in which a stalled lookup doesn't delay process.exit.

Originally created by @SpicyMarinara on GitHub (Nov 7, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8948 Originally assigned to: @SpicyMarinara on GitHub. ## Summary While the notices fetch's DNS lookup for `raw.githubusercontent.com` is pending, the server can't exit until the lookup returns, and a stalled system resolver can hold that for about 30 s. Affected: - the in-app **Restart Server** (`admin.routes.ts`, `process.exit(75)`); - signal shutdown; - the force-exit fallback (`armShutdownDeadline`). ## Details - `notices.routes.ts` fetches the notices URL at startup and hourly. Node resolves the host with `getaddrinfo` on the libuv threadpool, and `process.exit()` waits for pending threadpool work. - Probe with the same call shape (`fetch(url, { redirect: "error", signal: AbortSignal.timeout(10_000) })`, then `process.exit(75)` 200 ms later): with a working resolver the process is gone in 0.25 s; with a 15 s simulated lookup stall it's gone only after 15.28 s. - This is what broke the restart-supervisor and signal-shutdown CI lanes in #8947: the old server exited ~29 s after `process.exit`, past the supervisor's window. The tests now turn notices off (#8947's PR), but users with a slow or stalled resolver still see a stalled restart. A launcher Ctrl+C then ends with a SIGKILL after 10 s and exit code 137. - Saved data is safe: storage is flushed in `app.close()` before the exit. ## Expected A pending notices lookup never delays the process exiting. For example, resolve the notices host with `dns.resolve4`/`resolve6` (c-ares, off the threadpool) through a custom `lookup` on the fetch dispatcher, keeping `redirect: "error"` and the 10 s timeout. Add a regression in which a stalled lookup doesn't delay `process.exit`.
bsakaguchi 2026-11-07 23:46:58 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8903
No description provided.