Repository navigation
Conversation
Before multiplexed I/O starts, upstream reads the peer through safe_read() (io.c:351-358): a failed read() is "safe_read failed to read %d bytes" with the length the caller asked for, then exit_cleanup(RERR_STREAMIO). oc reported perform_io()'s "read error" and exited 10. The handshake reads in setup_protocol now mark their I/O failures; an end of stream or a timeout keeps its own path.
oferchen
merged commit Nov 3, 2026
889f1c6
into
fix/pull-trailer-role-and-daemon-exit-class
8 checks passed
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.
Stacked on #8287 and folded into it so the stack lands in one CI run.
Summary
Before multiplexed I/O starts, upstream reads the peer through
safe_read()(io.c:351-358). A failedread()there printssafe_read failed to read %d byteswith the length the caller asked for, then exits viaexit_cleanup(RERR_STREAMIO)(12). oc reported a reset at that stage as perform_io()'sread errorand exited 10.The handshake reads in
setup_protocolnow go through aSafeReadadapter that marks a failed read asSafeReadErrorcarrying the requested length;read_exactreports the whole buffer, as upstream does. The client's failure mapping turns it into upstream's line and code 12. An end of stream stays on the whine_about_eof path (safe_readreturns the short count, io.c:2158-2161), and a timeout stays on the check_timeout path.Evidence (rsync 3.5.1 release tarball, replayed daemon)
[Receiver] safe_read failed to read 1 bytes: Connection reset by peer (104), code 12[Receiver] read error: ..., code 10... failed to read 4 bytes ..., code 12read error, code 10Tests
a_reset_during_the_handshake_is_safe_reads_failure(Linux) covers both rows with the exact report lines.setup/safe_read.rs: a reset names the requested length; EOF and timeouts are left alone.check_rustfmt_all.py, workspace clippy-D warnings,dead_code_census.py, windows-gnu check of transfer and core; targeted nextest (transfer, core, cli) 218 passed.Notes
setup_protocolserves both roles; only the client's report text and exit code change, and on a server the error displays as upstream's safe_read line.