Repository navigation
fix: exit a daemon session with its transfer's code, log log_exit() - #8360
Merged
Merged
Conversation
oferchen
force-pushed
the
fix/daemon-session-exit-status
branch
6 times, most recently
from
November 11, 2026 10:31
c46cecc to
25329f3
Compare
A daemon session's process now exits with the code its transfer ended on, as rsync 3.5.1's per-connection child does (cleanup.c:264). - A transfer that ran to its end maps its io_error and got_xfer_error through cleanup.c:213-218, so a partial transfer exits 23. - A fatal one exits with its own RERR code, or with the peer's MSG_ERROR_EXIT code. - The forked TCP child and the stdio and inetd sessions all carry it. The daemon log follows log_exit() (log.c:937-963): - A fatal error logs the cause and the rsync error trailer it reports, replacing the invented "transfer failed to HOST" line. - The totals line is written only for a clean exit or a sender. Task 638.
oferchen
force-pushed
the
fix/daemon-session-exit-status
branch
from
November 11, 2026 10:49
25329f3 to
0e8b77d
Compare
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
A daemon session's process now exits with the code its transfer ended on, and the daemon log carries log_exit()'s lines in place of an invented summary, as rsync 3.5.1's per-connection child does.
io_errorandgot_xfer_errorto its code viacore::exit_code::io_error_exit_code, so a partial transfer exits 23.MSG_ERROR_EXITcode if one arrived (io.c:1930), otherwise with its own RERR code.session_exit_code. The forked TCP child now exits with it; before, it dropped it via.map(|_| ())and always exited 0. The stdio and inetd sessions already turned that field into their exit status.rsync error: ... (code N)trailer fromfatal_report_lines, the same lines the client is sent. This replaces the inventedtransfer failed to HOST (IP): module=M error=Eline.sent ... received ... total sizeline is written only for a clean exit or a sender (log.c:941).am_server = 2, cleanup.c:121-122).Evidence
All cells are measured against the 3.5.1 tarball build. Server exit statuses come from strace (TCP daemon) or an rsh shim (daemon mode via
--rsync-path).transfer failed tolinetests/daemon_session_exit_status.rscovers four cells in rsh daemon mode and asserts the server process's exit status and the daemon log. It is deterministic: the oc client reaps its rsh child before exiting. The unreadable-dir cell skips with a printed reason when run as root.Mutants, all killed:
session_exit_codeis not set: three cells.Residuals
mkdir ... failedcause. That is fix: report a failed destination-root mkdir as RERR_FILEIO on every path #8344 (local) and task 611 (daemon); this PR makes the session exit with whatever code is reported.[generator=on the receiver; 3.5.1 says[Receiver=for the pre-fork mkdir.link_stat ... failedline nor the real totals. That is task 280.--debug=EXIT, and upstream discards it. The strace oracle cell above covers it, and the rsh cells exercise the samesession_exit_codepath.Test plan
python3 tools/ci/check_rustfmt_all.pydaemoncargo nextest run -p daemon --all-features: 2152 passed-p bin(178),-p coreand-p transfer(530) daemon, inetd and stdio tests