fix(telegram): force IPv4 DNS on Jetson to prevent happy eyeballs timeout#1151
fix(telegram): force IPv4 DNS on Jetson to prevent happy eyeballs timeout#1151BrianYang-123 wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughConditionally applies a Jetson Tegra IPv4-only DNS override in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…eout
Node.js v22 happy eyeballs (autoSelectFamily) tries IPv6 connections
even when dns.setDefaultResultOrder('ipv4first') is set. On Jetson
Tegra kernels (5.15), IPv6 is non-functional (ENETUNREACH), and the
failed IPv6 attempt causes the IPv4 connection to also ETIMEDOUT.
dns.setDefaultResultOrder('ipv4first') alone is insufficient because
autoSelectFamily ignores DNS result ordering and tries all address
families regardless. Forcing family:4 at the dns.lookup level is the
only reliable fix — it prevents IPv6 addresses from reaching the
connection layer entirely.
The fix is guarded by /etc/nv_tegra_release detection so non-Jetson
platforms are unaffected.
Tested on Jetson Orin NX (L4T R36.4.3, kernel 5.15.148-tegra):
- Without fix: bridge crashes immediately (ETIMEDOUT + ENETUNREACH)
- With fix: bridge connects and operates normally
Refs: nodejs/node#52216
Signed-off-by: brianyang <brianyang@signalpro.com.tw>
c4c7c72 to
b636176
Compare
|
Closing — the target file The IPv4 DNS fix (monkey-patching |
Summary
Force IPv4 DNS resolution in
telegram-bridge.json Jetson platforms to fix immediate crash on startup.Problem
Node.js v22 enables the happy eyeballs algorithm (
autoSelectFamily) by default. On Jetson Tegra kernels (5.15), IPv6 is non-functional — the kernel lacks proper IPv6 connectivity, returningENETUNREACHfor any IPv6 connection attempt.The happy eyeballs implementation ignores
dns.setDefaultResultOrder('ipv4first')and tries all address families regardless of DNS ordering (nodejs/node#52216). The failed IPv6 attempt (ENETUNREACH) causes the entire connection to fail withETIMEDOUT, crashing the bridge on startup:Changes
scripts/telegram-bridge.js: Overridedns.lookupto forcefamily: 4(IPv4 only), guarded by/etc/nv_tegra_releasedetection so non-Jetson platforms are unaffected.Why dns.lookup override instead of simpler alternatives
dns.setDefaultResultOrder('ipv4first')autoSelectFamilyignores DNS result orderingnet.setDefaultAutoSelectFamily(false)undici/fetch()--no-network-family-autoselectionCLI flagundicidns.lookupoverride withfamily: 4Test plan
Tested on Jetson Orin NX (L4T R36.4.3, kernel 5.15.148-tegra, Node.js v22.13.1):
ETIMEDOUT+ENETUNREACHsetDefaultResultOrder('ipv4first')only: still crashesdns.lookupoverride (this PR): bridge starts and operates normally/etc/nv_tegra_release— no behavior change on non-Jetson platformsSummary by CodeRabbit
Signed-off-by: brianyang brianyang@signalpro.com.tw