Repository navigation
fix: skip local-copy temp, open and rename failures per file - #8285
Merged
oferchen merged 5 commits intoNov 3, 2026
Merged
Conversation
oferchen
added a commit
that referenced
this pull request
Oct 29, 2026
This was referenced Oct 29, 2026
oferchen
force-pushed
the
fix/receiver-open-per-file
branch
from
November 3, 2026 07:09
9cd0712 to
bc95ae9
Compare
A local copy that could not create its temp file, open an --inplace destination or rename a file into place aborted after the first file with its own wording, and a missing --inplace target was reported as vanished (exit 24). rsync 3.5.1 prints the receiver line for each file (receiver.c:465-468, receiver.c:1242-1261, rsync.c:918-927) and ends with exit 23. Move the commit-op tag and CommitDisposition classifier into engine so the network receiver and the local engine share one decision and one wording (CommitOp::failure_line). The engine tags its mkstemp, open, rename and copy sites, reports skip-file failures at the per-operand and per-entry sites, and counts NotFound as vanished only when it is untagged. The oc-only Direct write retries a failed create once through the named temp path, so the reported failure is upstream mkstemp one.
A receiver that could not create the --delay-updates / --partial-dir staging directory for a completed file aborted the whole run (exit 23 on a local copy, exit 3 on a push). rsync 3.5.1 prints "Unable to create partial-dir for %s -- discarding completed file.", unlinks the temp and moves on (receiver.c:1318-1325); the line is a plain FERROR, so the exit code is unchanged. Tag the staging-dir create with CommitOp::PartialDir in both receivers and classify it as the new CommitDisposition::Discard: the network receiver sends the line as MSG_ERROR without counting a skipped file, and the local engine reports it and resolves the entry to success.
oferchen
force-pushed
the
fix/local-copy-open-per-file
branch
from
November 3, 2026 07:24
6990bf9 to
91250da
Compare
fix: discard a file whose partial-dir cannot be created, like upstream
oferchen
added a commit
that referenced
this pull request
Nov 3, 2026
…, as upstream (#8284) * fix: skip receiver open and rename failures per file like upstream The pipelined receiver skipped a file only when its output failed with PermissionDenied; any other errno (ENOSPC, EROFS, EISDIR, and the ENOENT an --inplace open reports after its no-create retry) aborted the run. Upstream decides by the failed operation: a temp create, in-place open or rename into place is an FERROR_XFER line and the transfer goes on to exit 23 (receiver.c:465-468, receiver.c:1242-1261, rsync.c:918-927), while a failed backup or close is RERR_FILEIO. The split now lives in one classifier keyed on the CommitOp tag each raising site attaches. In-place and device opens are tagged Open and print upstream's "open %s failed" line, and a temp create under a missing parent keeps its Mkstemp tag and real errno. A missing --inplace destination is created 0600 until its final mode is applied (receiver.c:1221-1226). * docs: fill CHANGELOG PR number for #8284 * fix: report a failed cross-device copy fallback as upstream copy line robust_rename() falls back to copying when the rename crosses devices. Upstream reports a failed copy as "copy %s -> \"%s\"" (rsync.c:919-921, ret == -2) and moves on to the next file. The copy failure is now tagged CommitOp::Copy, which the per-file classifier skips and the receiver renders with the copy verb; an inner stage tag survives the rename tag the caller wraps around it. * fix: skip local-copy temp, open and rename failures per file A local copy that could not create its temp file, open an --inplace destination or rename a file into place aborted after the first file with its own wording, and a missing --inplace target was reported as vanished (exit 24). rsync 3.5.1 prints the receiver line for each file (receiver.c:465-468, receiver.c:1242-1261, rsync.c:918-927) and ends with exit 23. Move the commit-op tag and CommitDisposition classifier into engine so the network receiver and the local engine share one decision and one wording (CommitOp::failure_line). The engine tags its mkstemp, open, rename and copy sites, reports skip-file failures at the per-operand and per-entry sites, and counts NotFound as vanished only when it is untagged. The oc-only Direct write retries a failed create once through the named temp path, so the reported failure is upstream mkstemp one. * docs: fill CHANGELOG PR number for #8285 * fix: discard a file whose partial-dir cannot be created, like upstream A receiver that could not create the --delay-updates / --partial-dir staging directory for a completed file aborted the whole run (exit 23 on a local copy, exit 3 on a push). rsync 3.5.1 prints "Unable to create partial-dir for %s -- discarding completed file.", unlinks the temp and moves on (receiver.c:1318-1325); the line is a plain FERROR, so the exit code is unchanged. Tag the staging-dir create with CommitOp::PartialDir in both receivers and classify it as the new CommitDisposition::Discard: the network receiver sends the line as MSG_ERROR without counting a skipped file, and the local engine reports it and resolves the entry to success. * docs: fill CHANGELOG PR number for #8290 * fix: let a failed macOS clone fall through to the per-file temp path
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 local copy that cannot create its temp file, open an
--inplacedestination, or rename a file into place now behaves like rsync 3.5.1. It prints the receiver's per-fileFERROR_XFERline, skips that file, carries on with the next one, and exits 23. Before this change the engine aborted after the first file with its ownfailed to copy filewording. It also called a missing--inplacetarget "vanished" and exited 24.Stacked on #8284. That PR's commit-op tag and
CommitDispositionclassifier move down intoengine(engine::commit_failure), andtransferre-exports them, so the network receiver and the local engine decide from one place which failures skip a file and which ones abort the run.Changes
engine::commit_failure(moved fromtransfer::temp_guard):CommitOp,attach_commit_op[_between],commit_op_failure,commit_op_destinationandCommitDisposition.CommitOp::failure_linerenders upstream's wording for each operation. Both receivers use it.mkstemp.--inplace,--appendand one-inplace partial opens are taggedopen.rename, and the cross-device copy fallback is taggedcopy.LocalCopyError::report_skipped_commit: at the per-operand and per-directory-entry sites, a skip-file commit failure prints its line once and becomes a reported error. The run then ends with the code-23 trailer.NotFoundonly counts as vanished (exit 24) when it is untagged, i.e. it came from the source side.sender.c:715).Directwrite (no temp file for a new destination) has no upstream counterpart.mkstemp(receiver.c:465-468). That attempt's failure is the one reported.open_named_temp.Oracle (tarball 3.5.1,
/home/ofer/up351/rsync-3.5.1/rsync, Linux, non-root)Fixture:
src/a src/bintodst/. The sealed directory is 0555 for the run.mkstemp "dst/.a.XXXXXX" failed: Permission denied (13), exit 23failed to copy file 'dst/a', abort--temp-dirsealedmkstemp "tmp/a.XXXXXX" failed, exit 23--inplace, dst sealedopen "dst/a" failed: No such file or directory (2), exit 23rename "tmp/a.XXXXXX" -> "a": Permission denied (13), exit 23-r src/,--temp-dirsealedmkstemp "tmp/a.XXXXXX" failed, exit 23--inplacemodeThe only remaining difference is the trailer's program name and source location.
Tests
tests/receiver_open_failures_exit_23.rs:--serverreceiver) and local, against the same oracle lines.Walk::Recursivecell for files the directory walk reaches.a_tagged_not_found_is_a_receiver_failure_not_a_vanished_source.report_skipped_commit_marks_only_per_file_commit_failures_reported.failure_line_mirrors_each_upstream_rsyserr.an_inner_tag_survives_an_outer_one.NotFoundas vanished: the unit test and the in-place cell fail.Gates
fmt, workspace clippy
-D warnings,engine/transferno-default clippy,x86_64-pc-windows-gnucheck,xtask no-placeholders, nextestengine,transfer,core(11174 passed) and the e2e binary.permission_write_denied_destination_directoryused to pin the old abort (a rawIoerror). It now asserts upstream's per-file outcome: thePartialTransfersummary, exit 23, and no file landed.