Repository navigation
Conversation
The sync SSH spawn path already captures stderr through a socketpair on Unix, so the flag only adds the socketpair primitive and the async-ssh stderr drain. Ship them in default builds, pin the default in a test, and correct the docs that described a pipe as the default.
oferchen
marked this pull request as ready for review
October 20, 2026 13:21
oferchen
marked this pull request as draft
October 20, 2026 14:39
15 of 17 tasks
Owner
Author
|
Superseded by #8224. Analysis showed ssh::socketpair_stderr had no production caller, and upstream rsync never captures the ssh child's stderr (pipe.c piped_child only redirects stdin/stdout via fd_pair). #8224 mirrors upstream: the child inherits stderr, the server sets fd 2 blocking after setup (main.c:1364), and the ssh-socketpair-stderr feature is removed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rsync_iossh-socketpair-stderrfeature by default. Default builds now ship the socketpair stderr primitive and, underasync-ssh, the event-driven stderr drain.Details
What the flag gates
ssh::socketpair_stderr(standalone primitive)ssh-socketpair-stderrssh::async_stderr_drainasync-ssh+ssh-socketpair-stderrasync-sshis not a default featureAsyncSshTransportstderr channelasync-ssh+ssh-socketpair-stderrtracingdependency ofrsync_ioaux_channel::configure_stderr_channel(sync spawn path)coreandclidepend onrsync_iowith default features, so the default reaches theoc-rsyncbinary without a workspace forwarding feature. Thedaemoncrate keepsdefault-features = false. Windows compiles the same way as before, and stderr stays on the anonymous pipe there.Upstream reference:
pipe.c:57piped_child()creates the remote-shell child's stdin and stdout withutil1.c:84fd_pair(), asocketpair(2)underHAVE_SOCKETPAIR. Upstream leaves the child's stderr inherited, so capturing it through a socketpair is oc-specific and predates this PR.Docs corrected
docs/ssh-transport.md,docs/oc-rsync.1.md,docs/operator-migration-guide-vNEXT.mdand the README said default builds used a pipe for SSH stderr and the feature swapped in a socketpair. The code has used a socketpair on Unix regardless of the feature. The docs now describe what the code does, along with what the feature adds and how to opt out (--no-default-features). The design doc's backwards-compatibility section records the promotion.Measured: release builds, master 4d50d1b vs this branch, quiet host
These measurements were redone on a quiet host. The first set ran while another job's stress tests held the host's load near 300, so it could not support a gate decision.
Method. The run started only once the 1-minute load was under 2 and no other benchmark was running; that took 42 minutes of waiting. Load was 0.24 at the start and at most 1.22 during the run.
Cases. All four use
-e sshto localhost with--rsync-pathset to the binary under test:-vvvpush of the 2,000 files.Binaries. Three are compared: master, this branch, and a byte-identical copy of master. The copy is an A/A control and sets the noise floor.
Counts. Each case runs 9 interleaved rounds of master / branch / copy. Syscalls are
strace -f -ctotals for the client plus itssshchild, taken 3 times per binary. The tables show the median, and min-max in brackets.Gate. A case passes when branch minus master is within max(3%, A/A delta) for wall time and within the A/A delta for syscalls.
Wall time (seconds):
-vvvThe many-file push wall time is +6.4%, but the A/A copy differs from master by +9.0%, so the gap is within noise.
Syscalls (median of 3):
-vvvEvery syscall and wall difference sits inside the A/A noise floor or the 3% band, consistent with an unchanged runtime path.
Test plan
cargo fmt --all -- --checkandpython3 tools/ci/check_rustfmt_all.pycargo clippy --workspace --all-targets --all-features --no-deps -- -D warningscargo clippy -p rsync_io --all-targets --no-deps -- -D warnings(defaults), with--no-default-features, and-p corewith defaultscargo check -p rsync_io -p core --tests --target x86_64-pc-windows-gnucargo nextest run -p rsync_io --all-features(1518 passed)cargo nextest run -p rsync_io --no-default-features -E 'binary(ssh_stderr_default_path)'(2 passed)cargo nextest run -p rsync_io -E 'binary(ssh_stderr_default_path) | binary(ssh_stderr_socketpair_propagation) | binary(ssh_stderr_child_exit)'(7 passed)cargo nextest run --all-features -E 'binary(ssh_transport) | binary(server_diagnostics_reach_client)'(24 passed)python3 tools/ci/unsafe_owner_deps.py,cargo run -p xtask -- no-placeholders,cargo run -p xtask -- citationsssh_socketpair_stderr_is_a_default_featurereads thersync_iomanifest and fails when the feature is removed fromdefault(mutation checked).spawn_path_surfaces_child_stderrnow runs with and without the feature instead of only without it.Coordination
Conventional commit prefix
feat:- new user-visible featurePre-merge checklist
cargo fmt --allrun locally.CHANGELOG.mdupdated if user-visible.SECURITY.mdupdated if security-relevant.