Skip to content

Pre-existing latent hang in zipfian arbitrary-command path (test_zipfian_arbitrary_command_mixed_operations) under UBSan #482

Open

Description

@fcostaoliveira

Summary

tests_oss_zipfian_distribution.py::test_zipfian_arbitrary_command_mixed_operations (--threads 2 --clients 10 --requests 1000 with three arbitrary commands SET/GET/HSET + --command-key-pattern=Z) can hang (memtier never completes the run; RLTest kills it at the per-test timeout). It reproduces only on GitHub-hosted runners, and only when the compiled binary's hot-path codegen is perturbed.

Why this is filed as pre-existing (not caused by #475)

While working on #475 (Monitor-Input Fuzz fixes), the --test-time wall-clock backstop in run_benchmark() was found to deterministically tip this hang under the UBSan build — even though the backstop is gated on test_time > 0 and this test uses --requests (so the new code never executes for it). The hang is a function of binary codegen, not of the added logic:

  • The added code is never executed on this test's path.
  • A different fix location (an event_base_loopbreak in the hot process_response) tipped it under the normal build too.
  • Cold-function changes (stats printing, destructor, monitor loader) do not tip it.

This is the signature of a latent race / lost-wakeup in the arbitrary-command multi-connection path (TSAN is clean, so likely a missed wakeup rather than a data race) that master happens to sit on the safe side of.

Reproduction

Not reproducible locally despite ~470 standalone runs + multiple full-suite runs across: many-core, 2-core-pinned, 1-CPU-pinned, and 1-CPU + CPU-hog contention, under both normal and ASAN+UBSan builds. Only manifests on GH ubuntu-latest runners.

Current mitigation

test_zipfian_arbitrary_command_mixed_operations is skipped under the UBSan build (guarded on UBSAN_OPTIONS in the env) in #475, so the backstop fix can land. It still runs on the normal CI and ASAN builds. This skip should be removed once the underlying hang is fixed.

Next steps

  • Capture a thread backtrace of the hung process on a CI runner (e.g. SIGQUIT/gdb on timeout) to locate the lost wakeup in fill_pipeline/hold_pipeline/process_response coordination across the 2 worker threads.

Affected versions

The oversized stderr-log construction in tests/mb.py was introduced by beea70e32b68eb1a700969218ea967d4d0c33ddd (#322), first included in 2.3.0 and present through 2.5.2 and current master. The mixed arbitrary Zipfian workload was added earlier by 908ea0b79d1fdce6ff2f58ef2d0e8f25b4912002 (#314), first included in 2.2.0. These are source-history bounds for the harness behavior; they do not prove that every release/runner experiences the CI timeout.

Investigation update (2026-10-23)

PR #799's ASan run 39958248823 / job 120430093376 and TSan run 39958248869 / job 120429932881 both stalled immediately after DEBUG:root: >>> stderr <<< for the mixed-operation test. That marker occurs after process.communicate(timeout=240) returns. The earlier lost-wakeup/codegen explanation above remains a hypothesis, not an established cause of these failures.

An authenticated private local run using the downloaded binary from the failed ASan run completes the unchanged test in one second, while the harness emits a single 360,247-character escaped bytes-repr line. A narrow harness change that saves the original bytes first and displays decoded bounded lines also completes in one second, with longest displayed line 613 characters. The runner's own long-line issue documents similar CI log-processing stalls. This is evidence for a logging bottleneck; successful CI on the unchanged workload is still required before claiming the reported hang is resolved. No test skip, workload reduction or timeout increase is proposed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions