Repository navigation
fix: discard a file whose partial-dir cannot be created, like upstream - #8290
Merged
oferchen merged 2 commits intoNov 3, 2026
Merged
Conversation
oferchen
added a commit
that referenced
this pull request
Oct 29, 2026
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
oferchen
force-pushed
the
fix/partial-dir-create-discard
branch
from
November 3, 2026 07:31
ddddaf2 to
d376f20
Compare
4 tasks done
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
When a receiver cannot create the staging directory a completed file moves into under
--delay-updates, it now behaves like rsync 3.5.1:Unable to create partial-dir for <file> -- discarding completed file.This covers both
--delay-updates' implicit.~tmp~and an explicit relative or absolute--partial-dir. Before this change, both receivers aborted the whole run on the first file:failed to create partial dir '...';server error: Permission denied.upstream:
receiver.c:1318-1325. A failedhandle_partial_dir(partialptr, PDIR_CREATE)isrprintf(FERROR, ...),do_unlink_at(fnametmp)andrecv_ok = -1. PlainFERRORnever setsgot_xfer_error.Stacked on #8285, and reuses its shared commit classifier.
Changes
engine::commit_failure:CommitOp::PartialDir. Its operand is the staging dir; its destination is the file's final path.CommitDisposition::Discard: print a plain FERROR line, drop the file, and don't count it as a transfer error.failure_linerenders upstream's wording, naming the file by its transfer name.disk_commit/process/commit.rstags the obstruction clear and the staging-dir create.absorb_commit_errorsends the line asMessageCode::Error, notErrorXfer, and does not count a skipped file.stage_into_partial_dirtags its create.LocalCopyError::report_skipped_commitbecomesreport_commit_failure<T: Default>() -> Result<T, Self>. A discarded file resolves toOk(T::default()), so the walk carries on with no error.Oracle (tarball 3.5.1,
/home/ofer/up351/rsync-3.5.1/rsync, Linux, non-root)Fixture:
src/a src/bwith a writable--temp-dirand--delay-updates. The staging parent is 0555 for the run:dst, orapdfor the absolute case..~tmp~--partial-dir=.pd--partial-dir=<abs>/x--serverreceiver)Every cell matches 3.5.1:
Not changed (stated, not hidden)
These differences only appear under
-v, and none comes from this change:-vnames in a different order from upstream. That is the existing per-file warning-position work (tasks 379 and 382) and the decided local listing order.receivedtotal counts the two error lines, because oc's server sends them as MSG frames. 3.5.1's server writes them to stderr. This affects every server-side error line, not just this one. Raised separately.--partial. Therecv_ok == 0arm ("discarding partial file", where a failed transfer is kept in the partial dir) is not reachable deterministically from a fixture and is not wired here. oc's per-file failure path does not stage into the partial dir.Tests
tests/partial_dir_create_failure_discards.rs: 3 staging shapes x 3 transports. Each asserts the full stderr, exit 0, no file landed and an empty temp dir.a_partial_dir_failure_discards_without_a_transfer_error.PartialDirline infailure_line_mirrors_each_upstream_rsyserr.Discardarm inreport_commit_failure_marks_only_per_file_commit_failures_reported.Discardchanged toSkipFile: 2 unit tests and the 3 e2e tests fail.ErrorXfer: the 3 e2e tests fail.Discardturned into a reported error: the unit test and the 3 e2e tests fail.