[PR #4657] [MERGED] Log: at most 100 warnings or errors a minute from one line of code #5760

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

📋 Pull Request Information

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

Base: main ← Head: fix/log-flood-limit


📝 Commits (1)

  • 53ba582 Log: limit a warning or error from one line of code to 100 a minute

📊 Changes

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

View changed files

📝 crates/horizon-client-render/src/logging.rs (+120 -2)

📄 Description

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

What

The log now writes at most 100 warnings or errors from one line of code per minute:

  • the 100th is followed by 100 lines like this one in a minute: the next ones are counted, not logged;
  • the rest of that minute is counted, not written;
  • when that line of code logs again in a later minute, it is preceded by N more lines like the next one were not logged in the last minute.

Info lines (chat, joins, commands) are never limited. Below the limit the log is vanilla's, line for line; vanilla itself has no such limit.

Why

On the official server tonight, one warning repeated on every packet (vehicle N moved wrongly, fixed at its cause in #4650) wrote 250,000 lines (16 MB) in 30 minutes, at up to 6,700 a second. Any future bug of that kind would fill the disk the same way and cost the server thread time.

Test

a_warning_repeated_every_packet_is_counted_past_a_hundred_a_minute: 140 warnings from one line of code in a second write 100 and skip 40; another line of code has its own count; the next minute writes again and reports the 40 it left out.

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 073afd484, 1 min 32 s)

Check Result
Scope ✅ 1 files, +120 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (48 s)
rustfmt ✅ (5 s)
clippy ✅ (12 s)
tests: horizon-client-render ✅ 603 passed (7 s)
doc tests ✅ 0 passed (2 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 ➖ 63 affected, to run in CI (--quick): ambient_sound, arrow, block_removal, command_exec, composter, container_title, crafter, cursor_death, dedicated_server, dispenser, entity_components, entity_death_loot and 51 more
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/4657 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/log-flood-limit` --- ### 📝 Commits (1) - [`53ba582`](https://github.com/horizon-rust/horizon/commit/53ba58241968498d6cdc66f1181d9a55810b3ae7) Log: limit a warning or error from one line of code to 100 a minute ### 📊 Changes **1 file changed** (+120 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/logging.rs` (+120 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What The log now writes at most **100 warnings or errors from one line of code per minute**: - the 100th is followed by `100 lines like this one in a minute: the next ones are counted, not logged`; - the rest of that minute is counted, not written; - when that line of code logs again in a later minute, it is preceded by `N more lines like the next one were not logged in the last minute`. Info lines (chat, joins, commands) are never limited. Below the limit the log is vanilla's, line for line; vanilla itself has no such limit. ## Why On the official server tonight, one warning repeated on every packet (`vehicle N moved wrongly`, fixed at its cause in #4650) wrote 250,000 lines (16 MB) in 30 minutes, at up to 6,700 a second. Any future bug of that kind would fill the disk the same way and cost the server thread time. ## Test `a_warning_repeated_every_packet_is_counted_past_a_hundred_a_minute`: 140 warnings from one line of code in a second write 100 and skip 40; another line of code has its own count; the next minute writes again and reports the 40 it left out. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 073afd484, 1 min 32 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +120 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (48 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (12 s) | | tests: horizon-client-render | ✅ 603 passed (7 s) | | doc tests | ✅ 0 passed (2 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 | ➖ 63 affected, to run in CI (--quick): ambient_sound, arrow, block_removal, command_exec, composter, container_title, crafter, cursor_death, dedicated_server, dispenser, entity_components, entity_death_loot and 51 more | | 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 05:14: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#5760
No description provided.