Skip to content

fix(monitor-input): skip HELLO lines in the --monitor-input loader (2.4, part of #496) - #497

Merged
fcostaoliveira merged 6 commits into
2.4from
fix/monitor-input-hang-2.4
Jun 29, 2026
Merged

fcostaoliveira merged 6 commits into
2.4from
fix/monitor-input-hang-2.4

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Jun 26, 2026 •

Copy link
Copy Markdown
Collaborator

Backport of the master loader fix (#498).

Root cause

Replaying HELLO "<proto>" from --monitor-input switches the connection to RESP3; memtier's RESP2 reply parser then blocks forever on a reply it can't decode, and the in-flight read isn't bounded by --test-time, so the Monitor-Input Fuzz run wedges past the harness timeout (the latent hang #482). This is why the nightly failed every run.

Fix (loader-level, not corpus-scrubbing)

monitor_command_list::load_from_file now skips connection/protocol-negotiation commands (HELLO) so they can never be replayed as a workload — every other command in the file still runs. Reported as "N unreplayable line(s) skipped". The corpus keeps its HELLO line so the fuzzer exercises the skip path. (Merely deleting HELLO from the seed fixes nothing — a real MONITOR capture contains it and the fuzzer mutates toward it.)

Verified

A lone HELLO input now exits immediately (was a >12s wedge); the full 17_all_command_types seed loads 91/92 commands (1 unreplayable skipped) and runs clean. Full monitor-fuzz driver re-run for confirmation.

The deeper option (bound the in-flight read by --test-time so any wedging reply self-recovers) remains tracked as #482.


Note

Medium Risk
Loader behavior changes which commands replay from monitor captures (HELLO omitted); fuzz CI tuning affects nightly signal, not production benchmark defaults.

Overview
--monitor-input loader now drops HELLO lines during load_from_file so protocol negotiation is not replayed as workload (avoids RESP3 mid-stream and infinite RESP2 parse hangs from #482). Other commands in the file still load; stderr reports malformed vs unreplayable skip counts.

Monitor-Input Fuzz adds a post-mutation FUZZ_MAX_BYTES cap (2 MiB on CI) because compounded grow mutators exceed GROW_MAX, raises FUZZ_TIMEOUT to 180s for slow ASAN builds, and fixes failure artifact upload to include /tmp/mfuzz_* repro paths.

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

@fcostaoliveira fcostaoliveira changed the title fix(monitor-fuzz): drop HELLO "3" from 17_all_command_types seed (closes #496) fix(monitor-fuzz): drop HELLO "3" from 17_all_command_types seed (2.4, part of #496) Jun 26, 2026
@jit-ci

jit-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

…rt of #496)

Backport of the master fix: load_from_file skips connection/protocol-
negotiation commands (HELLO) so a captured/fuzzed `HELLO "3"` line can't be
replayed as a workload. Replaying HELLO switches the connection to RESP3,
after which the RESP2 reply parser blocks forever and --test-time can't
interrupt the in-flight read, wedging the Monitor-Input Fuzz nightly (#482).
Fixes it in the loader rather than by scrubbing the corpus.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@fcostaoliveira
fcostaoliveira force-pushed the fix/monitor-input-hang-2.4 branch from bb10538 to 0522aeb Compare June 26, 2026 12:20
@fcostaoliveira fcostaoliveira changed the title fix(monitor-fuzz): drop HELLO "3" from 17_all_command_types seed (2.4, part of #496) fix(monitor-input): skip HELLO lines in the --monitor-input loader (2.4, part of #496) Jun 26, 2026
fcostaoliveira and others added 5 commits June 26, 2026 19:21
…ented build (#496)

The HELLO loader-skip fix removed the real wedge, but the Monitor-Input
Fuzz nightly still failed on master: an 8 MiB grow-mutated --monitor-input
payload exceeds the 90s per-run timeout under master's heavier ASAN+UBSan
build (read-preference, CPU tracking, Prometheus). It's finite-but-slow,
not a hang -- the identical input completes in <20s locally and the exact
CI PRNG stream did not wedge in 470 local replays. Raise the per-run
timeout to 180s so slow large payloads finish; true (infinite) hangs are
unaffected since any timeout still trips them.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Even at FUZZ_TIMEOUT=180 the Monitor-Input Fuzz nightly still timed out on
master: a grow-mutated 8 MiB --monitor-input (seed 17_all_command_types)
takes >180s to load/replay under the heavier instrumented ASAN+UBSan build
on CI runners (the same input is <20s locally -- a >9x runner slowdown).
It's finite-but-slow, not a hang. Rather than keep raising the timeout,
cap FUZZ_GROW_MAX at 2 MiB so the worst-case grow payload processes in
~45s (4x margin under the 180s timeout). Large-input coverage is retained
by the 17 MiB / million-line synthetic seeds.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
)

GROW_MAX=2MiB did not actually bound payload size: mutate() applies up to
4 mutators, so several grows compound to ~8MiB regardless (the only true
bound was the hard 32MiB truncate). master's monitor-fuzz still timed out
at 180s on a ~8MiB input (~22s/MiB under the heavier ASAN+UBSan build on
CI; <20s locally) -- finite-but-slow, not a hang.

Make the post-mutation truncate cap env-configurable (FUZZ_MAX_BYTES,
default 32MiB) and set it to 2MiB in the nightly so the worst-case payload
processes in ~45s. Verified: max mutated size over 3000 mutations is now
exactly 2MiB. Large-input coverage retained via the synthetic seeds.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…nitor_*) (#496)

The driver saves repros via tempfile prefix mfuzz_ (/tmp/mfuzz_*.txt) but
the upload step globbed /tmp/fuzz_monitor_*, so on failure no reproducer
was ever uploaded -- which hampered diagnosing the master slowness here.
Cover both globs.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
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