[PR #6230] [MERGED] horizon-friends: the deadline test reads after the limit, so it ends on Windows #6731

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6230
Author: @Ragbie
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/friends-deadline-windows


📝 Commits (1)

  • 89bd321 horizon-friends: the deadline test reads after the limit, so it ends on Windows

📊 Changes

1 file changed (+42 additions, -2 deletions)

View changed files

📝 crates/horizon-friends/src/lib.rs (+42 -2)

📄 Description

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

What and why

horizon-friends' a_deadline_ends_the_stream_unless_dropped hung forever on Windows: it blocked in read with no timeout and waited for deadline's shutdown(Both) to wake it. Linux wakes a blocked reader on shutdown; Windows doesn't. It now reads once the limit has passed (with a read timeout, rejecting a timeout as the answer), so it ends on both.

A new test, a_deadline_ends_a_peer_that_sends_one_byte_at_a_time, checks what the deadline is for (Deadline's doc comment): a peer dripping a byte every 50 ms under the 1 s read timeout the callers set is cut near the 300 ms limit. It fails without the deadline (the loop would run ~5 s).

Players aren't affected: every read made while a Deadline is live also has a read timeout (direct::read_hello 5 s, kept by answer_code / exchange / secure on the same socket; the relay's first_line), and on Windows the first byte after the shutdown errors the read (measured 0.35 s with a 300 ms limit).

Fixes #6183

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

none (Horizon-only networking, test change)

Other projects' code

none

Self-check

Windows 11 and a Linux rust:1.98 container: cargo test -p horizon-friends --lib 35 passed, 5 runs and 3 runs. Before: the old test was killed by timeout 20 on Windows.

The one Python failure below is test_world_input_capture on Windows, unrelated to this branch: #6214, fixed in its own pull request.

pr_ready (tools/pr_ready.py --base upstream/main on Evrim-PC, against upstream/main at 41501a243, 8 min 31 s)

Check Result
Scope ✅ 1 files, +42 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 586 run, FAILED (errors=1, skipped=2) (1 min 57 s)
rustfmt ✅ (15 s)
clippy ✅ (2 min 26 s)
tests: horizon-friends ✅ 35 passed (11 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (1 min 44 s)
launcher tests ✅ 377 passed (1 min 51 s)
Parity ➖ not run (no vanilla data here): 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)

🤖 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/6230 **Author:** [@Ragbie](https://github.com/Ragbie) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/friends-deadline-windows` --- ### 📝 Commits (1) - [`89bd321`](https://github.com/horizon-rust/horizon/commit/89bd321b4a83ea14ba32346b80fbbf2d23b03908) horizon-friends: the deadline test reads after the limit, so it ends on Windows ### 📊 Changes **1 file changed** (+42 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-friends/src/lib.rs` (+42 -2) </details> ### 📄 Description > 🤖 Opened by Ragbie's AI agent (Claude Code, Opus 5.5), not by Ragbie personally. ## What and why `horizon-friends`' `a_deadline_ends_the_stream_unless_dropped` hung forever on Windows: it blocked in `read` with no timeout and waited for `deadline`'s `shutdown(Both)` to wake it. Linux wakes a blocked reader on shutdown; Windows doesn't. It now reads once the limit has passed (with a read timeout, rejecting a timeout as the answer), so it ends on both. A new test, `a_deadline_ends_a_peer_that_sends_one_byte_at_a_time`, checks what the deadline is for (`Deadline`'s doc comment): a peer dripping a byte every 50 ms under the 1 s read timeout the callers set is cut near the 300 ms limit. It fails without the deadline (the loop would run ~5 s). Players aren't affected: every read made while a `Deadline` is live also has a read timeout (`direct::read_hello` 5 s, kept by `answer_code` / `exchange` / `secure` on the same socket; the relay's `first_line`), and on Windows the first byte after the shutdown errors the read (measured 0.35 s with a 300 ms limit). Fixes #6183 ## 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 - [x] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference none (Horizon-only networking, test change) ## Other projects' code none ## Self-check Windows 11 and a Linux `rust:1.98` container: `cargo test -p horizon-friends --lib` 35 passed, 5 runs and 3 runs. Before: the old test was killed by `timeout 20` on Windows. The one Python failure below is `test_world_input_capture` on Windows, unrelated to this branch: #6214, fixed in its own pull request. **pr_ready** (`tools/pr_ready.py --base upstream/main` on Evrim-PC, against upstream/main at 41501a243, 8 min 31 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +42 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 586 run, FAILED (errors=1, skipped=2) (1 min 57 s) | | rustfmt | ✅ (15 s) | | clippy | ✅ (2 min 26 s) | | tests: horizon-friends | ✅ 35 passed (11 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (1 min 44 s) | | launcher tests | ✅ 377 passed (1 min 51 s) | | Parity | ➖ not run (no vanilla data here): 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) | 🤖 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:25:43 +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#6731
No description provided.