Skip to content

fix(dns): retry the ending list until it loads, then refresh hourly (0.118.2) - #584

Merged
ralyodio merged 1 commit into
mainfrom
fix/dns-endings-retry
Oct 17, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/dns-endings-retry

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Bug: moshcode dns start read the registry's ending list once, at startup. On a restart, the machine's own resolver is the bridge, which isn't listening yet, so the fetch fails. The bridge logs could not read the ending list and then answers every Moshpit name NXDOMAIN until it's restarted again.

Seen on bonita today: live.streaming and family.ancestry didn't resolve, even though dev2's bridge serves both and the same fetch succeeded seconds later.

Fix: keepEndingsFresh retries an empty list (5 s, 10 s, 30 s, then every 5 min). Once loaded, it refreshes hourly, so newly claimed endings resolve without a restart. A failed refresh never empties a good list. The set is filled in place, and the server already reads it on every query.

Tests: test/dns-endings-retry.test.mjs (3). All 428 DNS tests pass.

🤖 Generated with Claude Code

…y (0.118.2)

The bridge read the ending list once at start. Restarted on a machine
whose resolver is routed to it (the normal setup), it could not reach the
registry while it was itself not yet listening, logged 'could not read the
ending list', and answered every Moshpit name NXDOMAIN until restarted
again. Seen on bonita 2026-10-17: live.streaming and family.ancestry did
not resolve though dev2's bridge served both.

keepEndingsFresh retries an empty list (5 s, 10 s, 30 s, then every 5 min),
refreshes a loaded one hourly (new endings resolve without a restart), and
never empties a good list on a failed refresh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

1 finding(s) in the 3 file(s) this pull request changes.

HIGH/CRITICAL: 1

Severity Rule Location
HIGH tls-verification-disabled src/dns.mjs:823
105 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 7 | **MEDIUM**: 87 | **LOW**: 11

Not introduced by this pull request. The full set is in the Security tab.

Severity Rule Location
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:76
HIGH tls-verification-disabled apps/pwa/src/lib/moshpit-gateway.mjs:299
HIGH sh-remote-script-execution install.sh:86
HIGH sh-remote-script-execution install.sh:90
HIGH sh-remote-script-execution install.sh:258
HIGH sh-remote-script-execution install.sh:269
HIGH sh-remote-script-execution install.sh:275
MEDIUM js-unescaped-html-sink apps/pwa/public/herd/herd.js:117
MEDIUM sql-template-interpolation apps/pwa/src/lib/moshpit-certs.mjs:44
MEDIUM sql-template-interpolation apps/pwa/src/lib/moshpit-certs.mjs:82
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:139
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:153
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:179
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:373
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:377
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:422
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:674
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:870
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:872
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:931

…and 85 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit bad942f into main Oct 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant