Repository navigation
feat: spawn background stderr drain thread in SSH connection - #2912
Merged
Merged
Conversation
oferchen
force-pushed
the
feat/ssh-stderr-drain
branch
from
March 22, 2026 06:55
7b5013e to
6d46186
Compare
oferchen
added a commit
that referenced
this pull request
May 1, 2026
oferchen
added a commit
that referenced
this pull request
May 5, 2026
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
SshConnectionconstruction time instead of deferring tosplit(), preventing pipe-buffer deadlocks when the remote rsync writes large error output to stderr before the connection is splitArc<Mutex<Vec<u8>>>buffer (64 KB cap, oldest bytes discarded on overflow) while also forwarding lines toeprintln!stderr_output()on bothSshConnectionandSshChildHandlefor programmatic access to collected stderrwait_with_stderr()onSshChildHandlefor atomic exit-status + stderr retrieval after the handle is consumedstderr_mut()andtake_stderr()which are incompatible with eager drain (no non-test callers existed)Test plan
stderr_output_collected_via_child_handle- verifies stderr lines are captured and retrievable after waitstderr_output_empty_when_no_errors- verifies empty buffer when child produces no stderrstderr_output_bounded_to_cap- verifies 128 KB of stderr is truncated to 64 KB capstderr_output_readable_before_wait- verifies output is accessible via polling before child exitsstderr_drain_forwards_error_output_after_split,stderr_drain_handles_large_output_without_deadlock,stderr_drain_joins_on_drop,stderr_drain_with_no_stderr_output) continue to pass