Repository navigation
Conversation
Upstream exits on a received MSG_ERROR_EXIT through _exit_cleanup(val, __FILE__, 0 - __LINE__) (io.c:1930), and the negative line keeps log_exit() quiet (cleanup.c:221-225): the peer already reported the failure. Only a --log-file run without --info=stats still prints the trailer. oc added its own trailer.
oferchen
merged commit Nov 3, 2026
7fe4f6a
into
fix/pull-trailer-role-and-daemon-exit-class
0 of 2 checks passed
oferchen
added a commit
that referenced
this pull request
Nov 3, 2026
…e and error class (#8287) * fix: report pull failures from upstream's process and exit by class A pulling upstream client forks once its file list is in (main.c:1077 do_recv()): before that it is the lone "Receiver", after it the receiver child and the generator parent each report their own failures (rsync.c:987-995 who_am_i()). The receiver now marks that point on a ForkPoint, and one class mapping shared by the remote-shell and daemon transports turns a failure into upstream's report: - before the fork, every report names [Receiver]; - after it, end of stream and a reset socket print the receiver's report, then the generator's whine with its own count and exit 12, because those classes send no MSG_ERROR_EXIT (cleanup.c:240-256); - a --timeout after the fork is the generator's, followed by the receiver's SIGUSR1 trailer (io.c:256-266); - a peer exit code after the fork is closed by [generator]. The generator's count is the fork snapshot plus what the receiver forwards it: sub-lists (rsync.c:377-381), NDX_FLIST_EOF (rsync.c:359) and one notice per received file under inc_recurse, --remove-source-files or a hard link (receiver.c:1341-1347). A daemon pull no longer falls back to 23: end of stream exits 12, a reset socket 10, a silent peer under --timeout 30, and a destination root the client cannot create 11 with upstream's "mkdir ... failed" line (main.c:817-821). * docs: link the pull failure report entry to #8287 * chore: drop the dead-code allowlist row for the now-called serve * fix: print no exit trailer after the peer's MSG_ERROR_EXIT Upstream exits on a received MSG_ERROR_EXIT through _exit_cleanup(val, __FILE__, 0 - __LINE__) (io.c:1930), and the negative line keeps log_exit() quiet (cleanup.c:221-225): the peer already reported the failure. Only a --log-file run without --info=stats still prints the trailer. oc added its own trailer. * docs: link the peer error-exit entry to #8298 * fix: report a handshake reset as safe_read's failure, exit 12 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. * docs: link the handshake reset fix to its PR
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 (both change the client error mapping). Retarget to master once #8287 merges.
Summary
When the peer ends a run with
MSG_ERROR_EXIT, upstream exits through_exit_cleanup(val, __FILE__, 0 - __LINE__)(io.c:1930). The negative line keepslog_exit()quiet (cleanup.c:221-225) because the peer has already reported the failure. oc exited with the right code but added its own trailer, for exampleoc-rsync error: error in file IO (code 11) ... [sender=...]after the server's own lines.Upstream keeps one exception: a
--log-filerun withoutINFO_GTE(STATS, 1)still callslog_exit();-vsets that level (options.c:257). oc mirrors the exception.ClientErrorrecords that the run ended on the peer'sMSG_ERROR_EXIT(peer_error_exit_error, used by the rsh and daemon mapping sites).--log-fileis set and neither-vnor--info=statsis.Evidence (rsync 3.5.1 release tarball build)
oc-rsync error: ... (code 11) ... [sender], rc 11MSG_ERROR_EXIT(11)before the list--log-filersync error: error in file IO (code 11) at io.c(1930) [Receiver=3.5.1]-v --log-fileTests
Two replayed-daemon tests in
daemon_pull_unexpected_close_byte_count.rs:-v: exit 11 and no(code 11)line.--log-file: a trailer without-v, none with-v.Mutations, one per arm, all killed: leaving the flag unset fails both tests; removing the
--log-fileexception fails the second.Gates:
check_rustfmt_all.pyand workspace clippy-D warningsclean; windows-gnu check of core and cli clean; core + cli nextest 6878 passed; targeted transfer tests 7/7.Not in this PR
--log-fileon a failed run; upstream logs the trailer there too (task 543).MSG_ERROR_EXITand the drain until the peer exits (task 232).MSG_ERROR_EXITafter the file request, so the tests send it before the list, where 3.5.1 exits cleanly.