[PR #2496] [MERGED] dedicated_server: steps wait for the server's reply, not a 1.5 s timer #4367

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2496
Author: @ludovic111
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/dedicated-server-steps


📝 Commits (1)

  • 331e3a7 dedicated_server: steps wait for the server's reply, not a 1.5 s timer

📊 Changes

2 files changed (+57 additions, -8 deletions)

View changed files

📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java (+57 -7)
📝 tools/parity_hosts.json (+0 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

dedicated_server was a true flake: it failed and then passed at the same head on CI (10-26). Its Java parity client (VanillaProtocolClient) moved to the next step on a 1.5 s timer instead of on the server's reply. Under load, a reply landed in the wrong step. This happened with the respawn's add_entity / update_attributes / entity_event 19, with chat replies, and with furnace slots. A click could also carry a stale state id.

The fix:

  • Each chat, villager and furnace step now waits for the server's answer, with the same 30 s patience as a fallback:
    • its chat line;
    • both slot packets of a shift-click (a full menu resend counts as both);
    • the furnace totals the click changes (data 1 / data 3).
  • The respawn window keeps only the player's own entity packets. Before, a squid's swim event (entity event 19) or a mob coming into view fell into it depending on each server's tick timing.
  • dedicated_server comes off known_flaky in tools/parity_hosts.json.

Both servers (vanilla and Horizon) run the same client, so what is compared doesn't change, only when each step fires.

Before and after: I used a stall injector that SIGSTOPs the server for 2.5 s every 5 s, on the Mac mini at load ~50.

Client Result
main's client FAIL (furnace click order)
first version of this fix 2 FAIL (furnace data order, then the close order)
this branch 3 PASS (new3 on the previous iteration, then new5 and new6)

Without stalls it also passed (284 s under load). python3 -m unittest tests.test_parity_runner passes.

skip-release: test tooling only.

🤖 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/2496 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/dedicated-server-steps` --- ### 📝 Commits (1) - [`331e3a7`](https://github.com/horizon-rust/horizon/commit/331e3a7202a9f8c667ce46e3d53cba966a55b964) dedicated_server: steps wait for the server's reply, not a 1.5 s timer ### 📊 Changes **2 files changed** (+57 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java` (+57 -7) 📝 `tools/parity_hosts.json` (+0 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. `dedicated_server` was a true flake: it failed and then passed at the same head on CI (10-26). Its Java parity client (`VanillaProtocolClient`) moved to the next step on a 1.5 s timer instead of on the server's reply. Under load, a reply landed in the wrong step. This happened with the respawn's `add_entity` / `update_attributes` / `entity_event 19`, with chat replies, and with furnace slots. A click could also carry a stale state id. The fix: - Each chat, villager and furnace step now waits for the server's answer, with the same 30 s patience as a fallback: - its chat line; - both slot packets of a shift-click (a full menu resend counts as both); - the furnace totals the click changes (`data 1` / `data 3`). - The respawn window keeps only the player's own entity packets. Before, a squid's swim event (entity event 19) or a mob coming into view fell into it depending on each server's tick timing. - `dedicated_server` comes off `known_flaky` in `tools/parity_hosts.json`. Both servers (vanilla and Horizon) run the same client, so what is compared doesn't change, only when each step fires. Before and after: I used a stall injector that SIGSTOPs the server for 2.5 s every 5 s, on the Mac mini at load ~50. | Client | Result | |---|---| | main's client | FAIL (furnace click order) | | first version of this fix | 2 FAIL (furnace data order, then the close order) | | this branch | 3 PASS (`new3` on the previous iteration, then `new5` and `new6`) | Without stalls it also passed (284 s under load). `python3 -m unittest tests.test_parity_runner` passes. skip-release: test tooling only. 🤖 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 04:16:38 +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#4367
No description provided.