Skip to content

Bound benchmark stderr log lines without losing diagnostics - #810

Merged
fcostaoliveira merged 1 commit into
masterfrom
codex/fix482-bounded-harness-logs-20261023
Oct 23, 2026
Merged

fcostaoliveira merged 1 commit into
masterfrom
codex/fix482-bounded-harness-logs-20261023

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Verbose RLTest logging turns all captured benchmark stderr into one escaped bytes-repr line. The mixed Zipfian SET/GET/HSET workload produces thousands of expected WRONGTYPE messages, yielding a 360k-character log line. Two #799 sanitizer jobs stalled immediately before that line appeared and reached their 45-minute job limit.

Root cause

logging.debug(..., stderr_bytes) escapes each newline instead of preserving line boundaries. Both failed jobs reached the debug marker after communicate() returned, so their logs do not demonstrate a memtier worker deadlock. GitHub Actions has a documented long-line processing problem. This fixes the confirmed oversized-log construction; the connection to issue #482's historical hangs remains provisional until actual CI passes.

Fix

Save mb.stderr byte-for-byte before logging. When DEBUG is enabled, decode display text as UTF-8 with replacement for invalid bytes, preserve line boundaries, and split genuine long lines into chunks of at most 2048 characters. Nothing is truncated. Benchmark exit statuses, timeout behavior, workload and sanitizer coverage remain unchanged.

Tests

  • Three real-child RLTest regressions pass: multiline and long-line bounds, raw byte fidelity/save-before-log, invalid bytes and UTF-8, failure status with disabled DEBUG, and empty stderr. Verbose test assertions also avoid printing the large fixtures.
  • Paired fixture on base/fixed: largest record 273,060 → 2048 characters; raw saved bytes equal in both; save-before-log changes false → true.
  • Unchanged mixed Zipfian workload using the exact downloaded ASan binary from failed run 39958248823 passes locally before and after in one second. Largest displayed line 360,247 → 613 characters. No benchmark throughput improvement is claimed.
  • Python compile, Ruff F and diff checks pass. Current-head CI has 133 successful checks and one intentional skip. ASan and TSan plaintext jobs complete with zero failed tests, including the unchanged mixed Zipfian workload that previously stalled. All seven independent reviews approve. PR799 still needs this prerequisite integrated and its own CI before claiming that failure resolved.

Affected versions

The bytes-repr logging was introduced by beea70e (#322), first released in 2.3.0, and remains through 2.5.2/current master. The mixed Zipfian arbitrary-command test was introduced earlier by 908ea0b (#314), first released in 2.2.0. Source presence does not prove every release/runner exhibits the timeout.

Refs #482. Keep this issue open until PR799 also passes its own CI with the logging fix integrated.

🤖 Generated with Claude Code


Note

Low Risk
Test-harness logging only; benchmark execution, timeouts, and artifact bytes are unchanged aside from safer DEBUG output formatting.

Overview
Fixes CI log stalls when memtier benchmark stderr is huge (e.g. thousands of WRONGTYPE lines) by changing how Benchmark.run emits DEBUG diagnostics in tests/mb.py.

Raw stderr is still written to mb.stderr first, byte-for-byte, before any logging. When DEBUG is on, stderr is no longer passed as a single bytes object (which repr-escapes newlines into one massive line). It is decoded as UTF-8 with replacement, logged line-by-line, and lines longer than 2048 characters are split into multiple DEBUG records so nothing is dropped.

Adds tests/test_benchmark_logging.py with subprocess-based RLTest coverage: bounded log line length, full byte fidelity and save-before-log order, invalid UTF-8 handling, no stderr logging when DEBUG is off, and unchanged success/failure for empty stderr.

Reviewed by Cursor Bugbot for commit 97f9c77. Bugbot is set up for automated code reviews on this repo. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant