[PR #6737] [MERGED] Online join: try once more when the session service gives no answer, and log why #7064

Closed
opened 2026-11-03 06:33:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6737
Author: @4404c
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: auth/join-retry


📝 Commits (1)

  • 247ff24 Online join: try once more when the session service gives no answer

📊 Changes

1 file changed (+74 additions, -6 deletions)

View changed files

📝 crates/horizon-client-render/src/auth.rs (+74 -6)

📄 Description

🤖 Opened by 4404c's AI agent (Claude Code, Opus 5.5), not by 4404c personally.

What and why

Fixes #6736.

From time to time, joining an online server stops with "The authentication servers are currently not reachable", and joining again works at once. Horizon dropped the cause, so nobody can tell why. This:

  • logs it: the transport error, a 5xx's status, or the discovery fetch's error. The access token goes in the POST body, not in the URL these errors carry;
  • tries the join once more, after 500 ms, when the service gave no answer. join only records the server's hash, so repeating it is safe. An answer from the service (invalid session, banned, any other status) stands.

This differs from vanilla on purpose: vanilla shows the message and leaves the retry to the player. The player sees no other change. If you'd rather not have the retry, with_one_retry comes out on its own and the logging stays.

A failure lasting past the retry still shows the same message. Worst case, two 15 s timeouts come close to the server's login timeout.

The cause itself is still unknown: the error comes and goes and I couldn't provoke it, so this has not been seen fixing the real failure. The log will say what it is next time.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

ClientHandshakePacketListenerImpl.authenticateServer and authlib's MinecraftServicesSessionService.joinServer, as auth.rs already follows them; the retry is Horizon-only.

Tests: unit tests of with_one_retry in auth.rs (no answer is tried once more; an answer isn't). Nothing here ran against the real services, and the full client wasn't built locally: only horizon-client-render.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on naza, against upstream/main at e9eb640ac, 4 min 58 s)

Check Result
Scope ✅ 1 files, +74 −6
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 602 run, FAILED (errors=1, skipped=2) (1 min 42 s)
rustfmt ✅ (9 s)
clippy ✅ (1 min 47 s)
tests: horizon-client-render ✅ 1045 passed (1 min 14 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
mod API up to date ➖ native hooks 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)

The Python failure is test_capture_lifecycle, on this Windows checkout: the fixture's pointer warp count. It failed the same way on an earlier unchanged main (0454e97e3), and this change doesn't touch that code.

🤖 Generated with Claude Code


🔄 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/6737 **Author:** [@4404c](https://github.com/4404c) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `auth/join-retry` --- ### 📝 Commits (1) - [`247ff24`](https://github.com/horizon-rust/horizon/commit/247ff24c46d9d634c9fe360e1d070f3e52e9148a) Online join: try once more when the session service gives no answer ### 📊 Changes **1 file changed** (+74 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/auth.rs` (+74 -6) </details> ### 📄 Description > 🤖 Opened by 4404c's AI agent (Claude Code, Opus 5.5), not by 4404c personally. ## What and why Fixes #6736. From time to time, joining an online server stops with "The authentication servers are currently not reachable", and joining again works at once. Horizon dropped the cause, so nobody can tell why. This: - logs it: the transport error, a 5xx's status, or the discovery fetch's error. The access token goes in the POST body, not in the URL these errors carry; - tries the join once more, after 500 ms, when the service gave no answer. `join` only records the server's hash, so repeating it is safe. An answer from the service (invalid session, banned, any other status) stands. **This differs from vanilla on purpose**: vanilla shows the message and leaves the retry to the player. The player sees no other change. If you'd rather not have the retry, `with_one_retry` comes out on its own and the logging stays. A failure lasting past the retry still shows the same message. Worst case, two 15 s timeouts come close to the server's login timeout. The cause itself is still unknown: the error comes and goes and I couldn't provoke it, so this has not been seen fixing the real failure. The log will say what it is next time. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `ClientHandshakePacketListenerImpl.authenticateServer` and authlib's `MinecraftServicesSessionService.joinServer`, as `auth.rs` already follows them; the retry is Horizon-only. Tests: unit tests of `with_one_retry` in `auth.rs` (no answer is tried once more; an answer isn't). Nothing here ran against the real services, and the full client wasn't built locally: only `horizon-client-render`. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on naza, against upstream/main at e9eb640ac, 4 min 58 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +74 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 602 run, FAILED (errors=1, skipped=2) (1 min 42 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (1 min 47 s) | | tests: horizon-client-render | ✅ 1045 passed (1 min 14 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks 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) | The Python failure is `test_capture_lifecycle`, on this Windows checkout: the fixture's pointer warp count. It failed the same way on an earlier unchanged main (0454e97e3), and this change doesn't touch that code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:33:06 +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#7064
No description provided.