Repository navigation
fix(transfer): restore receiver-side mode-0 sentinel for --delete-missing-args - #5681
Merged
Merged
Conversation
oferchen
force-pushed
the
fix/uts-19-reopen-files-from-mode-0-1
branch
from
June 11, 2026 13:13
98742e2 to
8af546d
Compare
2 of 3 tasks
oferchen
force-pushed
the
fix/uts-19-reopen-files-from-mode-0-1
branch
from
June 11, 2026 18:00
aaf248b to
55f6211
Compare
…sing-args The sender side already emits a mode-0 sentinel file-list entry per upstream flist.c:2254-2258 when --delete-missing-args is in effect. PR #5523 added the matching receiver consumer, but PR #5541 (merged four hours later from a branch that pre-dated #5523) inadvertently deleted both `missing_args.rs` and its wire-up in the receiver transfer paths. Mode-0 entries are neither file, directory, symlink, nor special, so the existing create/transfer passes silently skip them, leaving the named destination path untouched. The upstream testsuite test `delete-missing-args-files-from` (issue #910) surfaces this as "missing-arg file ghost.txt was not deleted on the receiver" with a clean exit code 0. Restore the dedicated handler that mirrors upstream generator.c:1348-1354 (missing_args == 2 && file->mode == 0): iterate the file list once after directory/symlink creation but before the extraneous-delete sweep, remove the named destination path when it exists, and skip any further creation for that entry. Deletions route through the existing sandbox helpers (unlink_via_sandbox_or_fallback / recursive_unlinkat_via_sandbox_or_fallback) so the SEC-1.q TOCTOU guarantees still apply. dry_run and the absence of --delete-missing-args short-circuit the pass, matching upstream's statret guard and missing_args mode check. Wired into all three receiver transfer drivers (`run_pipelined`, `run_pipelined_incremental`, and `run_sync`) so the handler runs regardless of feature flags or fallback path. Regression coverage exercises the receiver against a real on-disk destination through both the wire-flist consume path (receive_file_list) and direct file_list construction, covering: file deletion, directory recursive removal, missing-destination no-op, dry-run skip, and the no-op when --delete-missing-args is off. upstream: generator.c:1348-1354 missing_args == 2 && file->mode == 0 upstream: flist.c:2254-2258 sender mode-0 sentinel emission
oferchen
force-pushed
the
fix/uts-19-reopen-files-from-mode-0-1
branch
from
June 11, 2026 18:30
55f6211 to
d1bad2c
Compare
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…sing-args (#5681) The sender side already emits a mode-0 sentinel file-list entry per upstream flist.c:2254-2258 when --delete-missing-args is in effect. PR #5523 added the matching receiver consumer, but PR #5541 (merged four hours later from a branch that pre-dated #5523) inadvertently deleted both `missing_args.rs` and its wire-up in the receiver transfer paths. Mode-0 entries are neither file, directory, symlink, nor special, so the existing create/transfer passes silently skip them, leaving the named destination path untouched. The upstream testsuite test `delete-missing-args-files-from` (issue #910) surfaces this as "missing-arg file ghost.txt was not deleted on the receiver" with a clean exit code 0. Restore the dedicated handler that mirrors upstream generator.c:1348-1354 (missing_args == 2 && file->mode == 0): iterate the file list once after directory/symlink creation but before the extraneous-delete sweep, remove the named destination path when it exists, and skip any further creation for that entry. Deletions route through the existing sandbox helpers (unlink_via_sandbox_or_fallback / recursive_unlinkat_via_sandbox_or_fallback) so the SEC-1.q TOCTOU guarantees still apply. dry_run and the absence of --delete-missing-args short-circuit the pass, matching upstream's statret guard and missing_args mode check. Wired into all three receiver transfer drivers (`run_pipelined`, `run_pipelined_incremental`, and `run_sync`) so the handler runs regardless of feature flags or fallback path. Regression coverage exercises the receiver against a real on-disk destination through both the wire-flist consume path (receive_file_list) and direct file_list construction, covering: file deletion, directory recursive removal, missing-destination no-op, dry-run skip, and the no-op when --delete-missing-args is off. upstream: generator.c:1348-1354 missing_args == 2 && file->mode == 0 upstream: flist.c:2254-2258 sender mode-0 sentinel emission
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
--delete-missing-argsmode-0 sentinel that PR fix: implement receiver-side mode-0 sentinel for --delete-missing-args #5523 originally landed.crates/transfer/src/receiver/directory/missing_args.rsand the wire-up in the three receiver transfer drivers.delete-missing-args-files-fromsurfaces this asmissing-arg file ghost.txt was not deleted on the receiver.Root cause
The receiver
run_pipelined,run_pipelined_incremental, andrun_syncdrivers had no consumer for mode-0 sentinel file-list entries. The sender side (crates/transfer/src/generator/file_list/walk.rs::emit_delete_sentinel) was already correctly emitting them perflist.c:2254-2258, but the receiver silently dropped them.Fix
process_missing_args_sentinelsmirroring upstreamgenerator.c:1348-1354(missing_args == 2 && file->mode == 0): iterate the file list after directory and symlink creation, before the extraneous-delete sweep; remove the named destination path when it exists; honourdry_runanddelete_missing_argsshort-circuits.unlink_via_sandbox_or_fallback,recursive_unlinkat_via_sandbox_or_fallback) so SEC-1.q TOCTOU guarantees still apply.run_pipelined,run_pipelined_incremental,run_sync) so the handler runs regardless ofincremental-flistfeature state or fallback path.Test plan
missing-arg file ghost.txt was not deleted on the receiver).testsuite/delete-missing-args-files-from_test.pyon Linux host with--use-tcp->PASS.crates/transfer/src/receiver/tests/file_list/missing_args_sentinel.rscovering: file deletion, directory recursive removal, missing-destination no-op, dry-run skip, no-op when--delete-missing-argsis off.Upstream references
flist.c:2254-2258- sender mode-0 sentinel emission (missing_args == 2).generator.c:1348-1354- receivermissing_args == 2 && file->mode == 0->delete_item().