Skip to content

test: pull wide and deep trees under incremental recursion, reporting hangs - #8264

Merged
oferchen merged 2 commits into
masterfrom
test/pull-inc-recurse-scale-shapes
Oct 29, 2026
Merged

oferchen merged 2 commits into
masterfrom
test/pull-inc-recurse-scale-shapes

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds crates/transfer/tests/inc_recurse_pull_scale_shapes.rs: two incremental-recursion pulls through the lsh stub, each asserting that every file arrives and that nothing extra appears.
    • One directory of 12,000 files, between two sibling directories. This is above upstream's MAX_FILECNT_LOOKAHEAD of 10,000 (rsync.h:151-152).
    • A 1,000-deep directory chain. The receiver frees its oldest lists (generator.c:2691-2712) while newer ones are still being sent (sender.c:525-545).
  • The tests keep no clock of their own. A hang is ended by nextest's slow-timeout, and the new test_support::run_reporting_hangs turns that termination into a failure that says where the transfer hung:
    • It runs the child in its own process group and hooks the runner's SIGTERM.
    • For every process in the group it prints each thread's name, state and kernel wait channel, plus a user-space backtrace when eu-stack is permitted.
    • It then kills the group, so no transfer outlives the test.
  • The SIGTERM hook is a new safe platform::signal::on_sigterm, built on signal-hook's blocking iterator. It lives in platform because that crate owns signal handling.

Test plan

  • Both pulls pass, with no SKIP (oc-rsync and lsh-stub built).
  • Oracle: rsync 3.5.1 completes both shapes on the same trees (12,000 files, and 1,000 levels).
  • Hang path proved end to end:
    • I deleted the receiver's per-segment NDX_DONE write. That deadlocks the deep pull: both ends sit in unix_stream_read_generic.
    • I ran the test binary and sent it SIGTERM, as nextest does at its timeout. The test exited 1 with a per-process, per-thread report naming both oc-rsync processes and the lsh stub, and no process survived.
    • The mutation was then restored with git.
  • Unit tests: on_sigterm runs its handler, and the process survives the signal. The report reads a live process group's command line, thread state and group membership.
  • fmt, check_rustfmt_all.py, workspace clippy --all-targets --all-features, no-default clippy for platform, test-support and transfer, windows-gnu cargo check --tests for the same three crates, unsafe_owner_deps.py, dead_code_census.py, xtask no-placeholders, nextest -p platform -p test-support -p transfer.

Known differences from upstream, measured but not changed here

  • A 2,000-deep chain: rsync 3.5.1 fails part-way. Its sender's opendir on a path past MAXPATHLEN reports Cannot allocate memory (12), so it transfers 1,023 of 2,000 files and exits 23. oc transfers all 2,000 and exits 0. The test stays at 1,000 levels, where both agree.
  • The 12,000-file directory on this host: oc took 1.12 s with 82 MB peak RSS; 3.5.1 took 0.28 s with 7.7 MB. This feeds the pull RSS and wall-time measurement task.

Coordination

  • Related PRs / issues: part of the pull incremental-recursion epic, with the released-segment directory-mtime and --delete-excluded PRs.
  • Depends on: none.
  • Blocked by: none.

Conventional commit prefix

  • test:

Pre-merge checklist

  • Conventional commit prefix on PR title matches the change category.
  • cargo fmt --all run locally.
  • CHANGELOG.md not updated: test-only harness, no user-visible change.
  • No references to internal tooling or non-human authoring aids; hyphens, not em-dashes.

@github-actions github-actions Bot added the test label Oct 28, 2026
Carries the session_fork.rs fix from #8253 so this branch's macOS jobs stop
failing on the master test-harness race: on EPERM for our own child, SIGKILL
the leader before a blocking WNOWAIT wait, and accept a setpgid refusal when the
child already leads its own group. The content is identical to #8253, so the
two merge without conflict.
@oferchen oferchen closed this Oct 29, 2026
@oferchen oferchen reopened this Oct 29, 2026
@oferchen oferchen closed this Oct 29, 2026
@oferchen oferchen reopened this Oct 29, 2026
@oferchen
oferchen merged commit 4e9de95 into master Oct 29, 2026
82 of 179 checks passed
@oferchen
oferchen deleted the test/pull-inc-recurse-scale-shapes branch October 29, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant