[PR #3547] [MERGED] Net: guard fast server disconnect against a stalled reader #5041

Closed
opened 2026-11-03 05:09:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3547
Author: @NikitaRTN
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: test/nonblocking-disconnect


📝 Commits (1)

  • 2b32b91 Net: guard non-blocking disconnect against a stalled reader

📊 Changes

1 file changed (+57 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/net.rs (+57 -0)

📄 Description

🤖 Opened by NikitaRTN's AI agent, not by NikitaRTN personally.

What and why

Add a regression test for the non-blocking multiplayer disconnect fixed by a5ee1e588c ("Leave a server at once instead of waiting for the reader thread"). The fix is already on main; this PR does not claim to implement it again.

A synthetic reader remains stalled until explicitly released (with a bounded fallback so a regression cannot hang the suite). The test covers both an explicit Session::disconnect and Drop, checks repeated cleanup, checks that the writer is removed, and verifies that disconnect does not wait for the reader. It releases the worker before assertions, even on the regression path.

Only a unit test changes. No gameplay, socket implementation, world saving, authentication, telemetry or launcher behavior changes.

Vanilla reference

None: regression-test coverage only. The unchanged implementation is already documented as the counterpart of Connection.disconnect.

Verification

GitHub CI passed for the current PR head 2b32b9142: checks run. Both verify and launcher succeeded. The CI Python suite ran 408 tests successfully. Parity jobs were skipped by the workflow; this is not a claim of parity execution.

The added disconnect_and_drop_do_not_wait_for_a_stalled_reader test passed in CI. The local Windows run also completed: 795 client tests passed, and doc tests passed (0 tests).

Local Windows self-check (completed; environment/platform failures)

The following is the completed local result, not the GitHub CI result. Local Python 3.10 cannot import tomllib; the suite also has platform-related failures. Local Rust 1.95 Clippy reports warnings in unchanged upstream code. Neither PR changes Python tools or those linted statements. These local failures are retained here rather than reported as passes. The current PR heads passed upstream CI without suppressing lints or changing unrelated code.

pr_ready (tools/pr_ready.py --quick on Windows (hostname redacted), against origin/main at 5a30084c1, 13 min 38 s)

Check Result
Scope PASS 1 file, +57 -0
Cargo.lock PASS unchanged
Public tree PASS
Python tests FAIL 389 run, FAILED (failures=1, errors=12, skipped=11) (1 min 20 s)
rustfmt PASS (13 s)
clippy FAIL failed (47 s)
tests: horizon-client PASS 795 passed (6 min 33 s)
doc tests PASS 0 passed (4 min 39 s)
content root tests SKIP content root untouched
tokens.css up to date SKIP theme untouched
launcher rustfmt SKIP launcher untouched
launcher clippy SKIP launcher untouched
launcher tests SKIP launcher untouched
Parity SKIP 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)

Suggested label: skip-release (test-only; no new player-visible change). The runtime fix is already on main in a5ee1e588; this PR adds regression coverage only.

Maintainer edits are allowed.

Made with AI — GPT 6.1 Sol.


🔄 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/3547 **Author:** [@NikitaRTN](https://github.com/NikitaRTN) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `test/nonblocking-disconnect` --- ### 📝 Commits (1) - [`2b32b91`](https://github.com/horizon-rust/horizon/commit/2b32b9142f0eaffcc084a4ba501c2d4ce4c3a375) Net: guard non-blocking disconnect against a stalled reader ### 📊 Changes **1 file changed** (+57 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/net.rs` (+57 -0) </details> ### 📄 Description > 🤖 Opened by NikitaRTN's AI agent, not by NikitaRTN personally. ## What and why Add a regression test for the non-blocking multiplayer disconnect fixed by a5ee1e588cde2c1760d3fb07a44c8dd98792d25d ("Leave a server at once instead of waiting for the reader thread"). **The fix is already on main; this PR does not claim to implement it again.** A synthetic reader remains stalled until explicitly released (with a bounded fallback so a regression cannot hang the suite). The test covers both an explicit `Session::disconnect` and `Drop`, checks repeated cleanup, checks that the writer is removed, and verifies that disconnect does not wait for the reader. It releases the worker before assertions, even on the regression path. Only a unit test changes. No gameplay, socket implementation, world saving, authentication, telemetry or launcher behavior changes. ## Vanilla reference None: regression-test coverage only. The unchanged implementation is already documented as the counterpart of `Connection.disconnect`. ## Verification **GitHub CI passed for the current PR head `2b32b9142`:** [checks run](https://github.com/horizon-rust/horizon/actions/runs/40839135269). Both `verify` and `launcher` succeeded. The CI Python suite ran 408 tests successfully. Parity jobs were skipped by the workflow; this is not a claim of parity execution. The added `disconnect_and_drop_do_not_wait_for_a_stalled_reader` test passed in CI. The local Windows run also completed: **795 client tests passed**, and doc tests passed (0 tests). ### Local Windows self-check (completed; environment/platform failures) The following is the completed local result, not the GitHub CI result. Local Python 3.10 cannot import `tomllib`; the suite also has platform-related failures. Local Rust 1.95 Clippy reports warnings in unchanged upstream code. Neither PR changes Python tools or those linted statements. These local failures are retained here rather than reported as passes. The current PR heads passed upstream CI without suppressing lints or changing unrelated code. **pr_ready** (`tools/pr_ready.py --quick` on Windows (hostname redacted), against origin/main at 5a30084c1, 13 min 38 s) | Check | Result | | --- | --- | | Scope | PASS 1 file, +57 -0 | | Cargo.lock | PASS unchanged | | Public tree | PASS | | Python tests | FAIL 389 run, FAILED (failures=1, errors=12, skipped=11) (1 min 20 s) | | rustfmt | PASS (13 s) | | clippy | FAIL failed (47 s) | | tests: horizon-client | PASS 795 passed (6 min 33 s) | | doc tests | PASS 0 passed (4 min 39 s) | | content root tests | SKIP content root untouched | | tokens.css up to date | SKIP theme untouched | | launcher rustfmt | SKIP launcher untouched | | launcher clippy | SKIP launcher untouched | | launcher tests | SKIP launcher untouched | | Parity | SKIP 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) | Suggested label: `skip-release` (test-only; no new player-visible change). The runtime fix is already on main in a5ee1e588; this PR adds regression coverage only. Maintainer edits are allowed. Made with AI — GPT 6.1 Sol. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:09:49 +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#5041
No description provided.