Repository navigation
test(rsync_io): SSH stderr socketpair error propagation (#2375) - #4384
Merged
Merged
Conversation
oferchen
force-pushed
the
test/sse-stderr-socketpair-propagation
branch
from
May 18, 2026 00:12
0a8d6ea to
f245d78
Compare
SSE-6 from docs/design/socketpair-stderr-channel.md. Drives the SSE-3 `make_stderr_socketpair` primitive end-to-end by wiring the child end into a real subprocess as fd 2 and asserting the parent end surfaces the bytes verbatim. Each captured line additionally fires a `tracing::warn!` event, mirroring the production drain shape staged in SSE-4 (#4363) so this test continues to exercise the observable contract once the async path lands. Scenarios: - single_error_line_propagates_through_socketpair: one echo writes `test error message\n`; parent buffer matches byte-for-byte and a single WARN event fires with the captured payload. - multi_error_lines_propagate_and_fire_one_warn_each: three separate echo calls produce three ordered lines; all three are captured in order and one WARN event fires per line. - drain_returns_after_child_exit_closes_child_end: confirms the drain observes EOF cleanly when the subprocess exits and the child end closes, guarding the failure mode the design doc calls out under "Tokio drain task survives past child reap". Gated `cfg(all(unix, feature = "ssh-socketpair-stderr"))` so the file no-ops on Windows and on default builds. Adds `tracing` and `tracing-subscriber` as dev-dependencies of `rsync_io`; a custom `Layer` records WARN events with thread-local dispatch propagated to the spawned drain thread.
oferchen
force-pushed
the
test/sse-stderr-socketpair-propagation
branch
from
May 18, 2026 00:57
f245d78 to
af84709
Compare
oferchen
added a commit
that referenced
this pull request
May 18, 2026
SSE-6 from docs/design/socketpair-stderr-channel.md. Drives the SSE-3 `make_stderr_socketpair` primitive end-to-end by wiring the child end into a real subprocess as fd 2 and asserting the parent end surfaces the bytes verbatim. Each captured line additionally fires a `tracing::warn!` event, mirroring the production drain shape staged in SSE-4 (#4363) so this test continues to exercise the observable contract once the async path lands. Scenarios: - single_error_line_propagates_through_socketpair: one echo writes `test error message\n`; parent buffer matches byte-for-byte and a single WARN event fires with the captured payload. - multi_error_lines_propagate_and_fire_one_warn_each: three separate echo calls produce three ordered lines; all three are captured in order and one WARN event fires per line. - drain_returns_after_child_exit_closes_child_end: confirms the drain observes EOF cleanly when the subprocess exits and the child end closes, guarding the failure mode the design doc calls out under "Tokio drain task survives past child reap". Gated `cfg(all(unix, feature = "ssh-socketpair-stderr"))` so the file no-ops on Windows and on default builds. Adds `tracing` and `tracing-subscriber` as dev-dependencies of `rsync_io`; a custom `Layer` records WARN events with thread-local dispatch propagated to the spawned drain thread.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
SSE-6 from docs/design/socketpair-stderr-channel.md. Drives the SSE-3 `make_stderr_socketpair` primitive end-to-end by wiring the child end into a real subprocess as fd 2 and asserting the parent end surfaces the bytes verbatim. Each captured line additionally fires a `tracing::warn!` event, mirroring the production drain shape staged in SSE-4 (#4363) so this test continues to exercise the observable contract once the async path lands. Scenarios: - single_error_line_propagates_through_socketpair: one echo writes `test error message\n`; parent buffer matches byte-for-byte and a single WARN event fires with the captured payload. - multi_error_lines_propagate_and_fire_one_warn_each: three separate echo calls produce three ordered lines; all three are captured in order and one WARN event fires per line. - drain_returns_after_child_exit_closes_child_end: confirms the drain observes EOF cleanly when the subprocess exits and the child end closes, guarding the failure mode the design doc calls out under "Tokio drain task survives past child reap". Gated `cfg(all(unix, feature = "ssh-socketpair-stderr"))` so the file no-ops on Windows and on default builds. Adds `tracing` and `tracing-subscriber` as dev-dependencies of `rsync_io`; a custom `Layer` records WARN events with thread-local dispatch propagated to the spawned drain thread.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
SSE-6 from docs/design/socketpair-stderr-channel.md. Drives the SSE-3 `make_stderr_socketpair` primitive end-to-end by wiring the child end into a real subprocess as fd 2 and asserting the parent end surfaces the bytes verbatim. Each captured line additionally fires a `tracing::warn!` event, mirroring the production drain shape staged in SSE-4 (#4363) so this test continues to exercise the observable contract once the async path lands. Scenarios: - single_error_line_propagates_through_socketpair: one echo writes `test error message\n`; parent buffer matches byte-for-byte and a single WARN event fires with the captured payload. - multi_error_lines_propagate_and_fire_one_warn_each: three separate echo calls produce three ordered lines; all three are captured in order and one WARN event fires per line. - drain_returns_after_child_exit_closes_child_end: confirms the drain observes EOF cleanly when the subprocess exits and the child end closes, guarding the failure mode the design doc calls out under "Tokio drain task survives past child reap". Gated `cfg(all(unix, feature = "ssh-socketpair-stderr"))` so the file no-ops on Windows and on default builds. Adds `tracing` and `tracing-subscriber` as dev-dependencies of `rsync_io`; a custom `Layer` records WARN events with thread-local dispatch propagated to the spawned drain thread.
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
crates/rsync_io/tests/ssh_stderr_socketpair_propagation.rs(SSE-6, feat: wire --dparam values to daemon config override #2375): three integration tests that drive the SSE-3make_stderr_socketpairprimitive end-to-end and assert error-message propagation from a spawned subprocess back through the parent end of the socketpair.tracing::warn!event so the test exercises the observable contract the SSE-4 async drain (PR feat(rsync_io): async stderr drain task for SSH socketpair (#2373) #4363) is staging - the production drain shape is mirrored line-by-line.tracingandtracing-subscriberintorsync_iodev-dependencies and installs a customLayerthat records WARN events, with thread-local dispatch propagated to the spawned drain thread viatracing::dispatcher::with_default.Scenarios
single_error_line_propagates_through_socketpair:/bin/sh -c 'echo "test error message" >&2'; parent end yields exactlytest error message\nand one WARN event carrying that payload.multi_error_lines_propagate_and_fire_one_warn_each: three sequentialechocalls; all three lines surface in order and one WARN event fires per line.drain_returns_after_child_exit_closes_child_end: confirms the drain observes EOF cleanly after the subprocess exits (guards the "drain task survives past child reap" risk called out in the design doc).Gated
cfg(all(unix, feature = "ssh-socketpair-stderr"))so the file no-ops on Windows and on default builds, matching the staging plan indocs/design/socketpair-stderr-channel.md.Test plan
cargo nextest run -p rsync_io --features ssh-socketpair-stderr --test ssh_stderr_socketpair_propagation-> 3 passedcargo clippy -p rsync_io --tests --features ssh-socketpair-stderr --no-deps -- -D warnings-> cleancargo fmt --all -- --check-> clean