mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8953] [MERGED] fix(server): a pending notices lookup can't hold Restart Server or shutdown #8910
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8910
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8953
Author: @SpicyMarinara
Created: 11/7/2026
Status: ✅ Merged
Merged: 11/7/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/notices-dns-exit📝 Commits (2)
c752bc1fix(server): resolve the notices host with c-ares so a stalled lookup cannot hold exit106a35dfix(server): harden the c-ares notices lookup after review📊 Changes
5 files changed (+429 additions, -4 deletions)
View changed files
📝
docs/CONFIGURATION.md(+3 -1)📝
packages/server/src/routes/notices.routes.ts(+92 -1)📝
packages/server/src/utils/security.ts(+9 -2)➕
scripts/regressions/fixtures/stalled-resolver.mjs(+49 -0)➕
scripts/regressions/marinara-notices-dns-exit.regression.ts(+276 -0)📄 Description
Linked issue
Closes #8948
Why this change
On a stalled system resolver, Restart Server, signal shutdown and the force-exit fallback could hang for up to ~30 s. A launcher Ctrl+C then ended with a SIGKILL and exit 137. The notices fetch resolved
raw.githubusercontent.comwithgetaddrinfoon the libuv threadpool, andprocess.exit()waits for pending threadpool work. #8947 found this through the restart-supervisor flake.What changed
packages/server/src/routes/notices.routes.ts: each refresh builds its own dispatcher, through the existingcreateDispatcher, which already honoursNODE_USE_ENV_PROXY. Its customlookup:localhostto 127.0.0.1 and ::1;/etc/hosts, or the Windowsdrivers\etc\hosts), so a pinnedraw.githubusercontent.comand Docker'sextra_hostsstill work;dns.resolve4/resolve6), which doesn't use the threadpool. It returns as soon as one family answers and gives the other at most 1 s more, so a router that drops AAAA queries can't stall it.proxyTls.lookup), so a proxy given by host name doesn't fall back togetaddrinfo.redirect: "error"and the 10 s timeout are unchanged, andMARINARA_NOTICES_ENABLED=falsereturns before any DNS work.try. A malformedHTTP(S)_PROXY(for example127.0.0.1:10809with no scheme) now logs a warning instead of crashing the server through an unhandled rejection.getaddrinfo. Aponytail:comment records the limit and the upgrade path, a child-process lookup.packages/server/src/utils/security.ts:createDispatcheris exported, and it keeps a caller'sproxyTlsoptions when adding keepalive. Other callers behave as before.docs/CONFIGURATION.md: the notices host, and an outbound proxy's host, are found through the hosts file and DNS servers only, so.localand short names other thanlocalhostdon't work. It also explains Termux's resolver config.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agents (not a substitute for the boxes above):
marinara-notices-dns-exit.regression.ts, with a stalled-resolver preload. Child servers call the real/api/admin/restartwhile the notices lookup is in flight:process.exitfor the stall;pnpm check, plusmarinara-notices,admin-server-restart,restart-supervisor,restart-diagnostics,shutdown-deadline,server-signal-shutdown,robustness-shutdown-safety,route-rate-limits,llm-env-proxyandsafe-fetch-redirect-local-trust: pass.Still to verify by hand:
Known limits, also documented:
MARINARA_NOTICES_URLon a.localor short name no longer resolves.safeFetch) still usegetaddrinfo, which is out of scope here.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.