Skip to content

Fix the race that made the pipeline halt test flaky #32

Closed

Description

@SDL-A1

Migrated from SergioDemianLerner/rustock#32 (pull request by @SDL-A1, 2026-09-21).
Merged: yes. The commits are already in this repository's history.
Original: SergioDemianLerner/rustock#32

test_pipeline_exec_failure_halts failed about five runs in eight. test_pipeline_depth_capped_at_one_ahead shared the same race but would have hung rather than failed, so it was never noticed.

The race

ExecController signals completion from inside the execution closure, so wait_completed returns before the closure returns and before the spawn_blocking JoinHandle is marked finished. poll_execution skips a job whose handle is not finished, so the single on_tick that followed reaped nothing — and none of the reap's effects were visible. The parked batch was still parked, which is exactly what the assertion reported.

Why this is a test fix and not a production one

Nothing is wrong with the production path: it ticks on a timer and reaps on whichever tick comes after the handle settles. Only a test that asserts on the reap has to wait for it, which is what await_reapable_execution_for_test does — with a deadline, so that a job which is genuinely blocked fails saying so rather than hanging.

Testing

  • 40/40 consecutive runs of test_pipeline_exec_failure_halts pass (previously ~5-in-8 failing).
  • 8/8 consecutive runs of the whole 122-test crate pass.

Unrelated: /tmp exhaustion on the build host

Worth recording, because it produced failures that look like flakiness but are not. Running the full crate in parallel also showed 3–6 failures per run with No space left on device — /tmp is a 3.8 GB tmpfs and was 97% full. tempfile only cleans up on a normal Drop, so every killed cargo test run leaks its RocksDB temp directories; roughly 2,200 had accumulated, some dating back ten days. That is an environment problem rather than anything in this repo, but it will keep causing spurious RocksDB failures in anyone's test run until the stale directories are cleared.

🤖 Generated with Claude Code

Activity

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

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