[PR #2752] [MERGED] server connection: dead name servers and addresses no longer hold up pings and joins #4585

Closed
opened 2026-11-03 04:18:16 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2752
Author: @iLostName
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: faster-server-connect


📝 Commits (2)

  • 6fc2006 dns: leave out scoped IPv6 name servers on Windows, as JNDI does
  • de8dd66 connection: try a server's addresses side by side, 250 ms apart

📊 Changes

2 files changed (+103 additions, -11 deletions)

View changed files

📝 crates/horizon-protocol/src/connection.rs (+83 -9)
📝 crates/horizon-protocol/src/resolver/dns.rs (+20 -2)

📄 Description

What and why

Pinging or joining some servers took 3–8 s before a 20 ms ping (play.coralmc.it here). Two causes:

  • On Windows the SRV query also asked scoped IPv6 name servers (Tailscale's fec0:0:0:ffff::1-3, 1 s timeout each).
  • A round-robin host (19 addresses, 10 dead) was tried one address at a time with the full 5 s timeout.

Name servers now leave out scoped IPv6 ones, and a server's addresses start 250 ms apart side by side (RFC 8305), the first to connect winning: 70–120 ms now.

Vanilla reference

JNDI's name servers (ResolverConfiguration.nameservers(), [1.1.1.1, 1.0.0.1] with JDK 25 on the same machine). Racing the addresses is Horizon-only: vanilla connects to the first address only. That address still starts first, and its failure is the one reported.

Self-check

pr_ready (tools/pr_ready.py --quick on PC-Lost, against origin/main at 12e0094f1, 1 min 38 s)

Check Result
Scope ✅ 9 files, +150 −11
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 331 run, FAILED (failures=2, errors=8, skipped=11) (48 s)
rustfmt ✅ (9 s)
clippy ❌ failed (29 s)
tests: horizon-protocol ✅ 103 passed (4 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Run on Windows: the Python tests fail there and are unrelated; clippy stops at the duplicate minecraft:rabbit arm in entity_nbt.rs:502, already on main (#2719 fixes it). Scope counts untracked local files.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2752 **Author:** [@iLostName](https://github.com/iLostName) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `faster-server-connect` --- ### 📝 Commits (2) - [`6fc2006`](https://github.com/horizon-rust/horizon/commit/6fc2006447b6a6d9fd124e886ae4854a37e39c51) dns: leave out scoped IPv6 name servers on Windows, as JNDI does - [`de8dd66`](https://github.com/horizon-rust/horizon/commit/de8dd66ac22770c236002b43fc7082ec399fdd4e) connection: try a server's addresses side by side, 250 ms apart ### 📊 Changes **2 files changed** (+103 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-protocol/src/connection.rs` (+83 -9) 📝 `crates/horizon-protocol/src/resolver/dns.rs` (+20 -2) </details> ### 📄 Description ## What and why Pinging or joining some servers took 3–8 s before a 20 ms ping (`play.coralmc.it` here). Two causes: - On Windows the SRV query also asked scoped IPv6 name servers (Tailscale's `fec0:0:0:ffff::1-3`, 1 s timeout each). - A round-robin host (19 addresses, 10 dead) was tried one address at a time with the full 5 s timeout. Name servers now leave out scoped IPv6 ones, and a server's addresses start 250 ms apart side by side (RFC 8305), the first to connect winning: 70–120 ms now. ## Vanilla reference JNDI's name servers (`ResolverConfiguration.nameservers()`, `[1.1.1.1, 1.0.0.1]` with JDK 25 on the same machine). Racing the addresses is Horizon-only: vanilla connects to the first address only. That address still starts first, and its failure is the one reported. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on PC-Lost, against origin/main at 12e0094f1, 1 min 38 s) | Check | Result | | --- | --- | | Scope | ✅ 9 files, +150 −11 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 331 run, FAILED (failures=2, errors=8, skipped=11) (48 s) | | rustfmt | ✅ (9 s) | | clippy | ❌ failed (29 s) | | tests: horizon-protocol | ✅ 103 passed (4 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Run on Windows: the Python tests fail there and are unrelated; clippy stops at the duplicate `minecraft:rabbit` arm in `entity_nbt.rs:502`, already on main (#2719 fixes it). Scope counts untracked local files. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:18:16 +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
horizon-rust/horizon#4585
No description provided.