Repository navigation
feat: add missing daemon config directives and fix unknown directive handling - #2381
Merged
Merged
Conversation
…handling Add 11 new per-module configuration directives to the daemon config parser: max_verbosity, ignore_errors, ignore_nonreadable, transfer_logging, log_format, dont_compress, pre_xfer_exec, post_xfer_exec, temp_dir, charset, and forward_lookup. These mirror upstream rsync's rsyncd.conf parameters from loadparm.c. Change unknown directive handling to log a warning and continue instead of returning an error, for both global and per-module sections. This matches upstream rsync's behavior of gracefully ignoring unrecognized directives.
oferchen
added a commit
that referenced
this pull request
Feb 21, 2026
Add execution logic for the pre-xfer exec and post-xfer exec daemon module directives. The config fields and parsing were added in #2381; this wires up the actual command execution with upstream-compatible environment variables (RSYNC_MODULE_NAME, RSYNC_MODULE_PATH, RSYNC_HOST_ADDR, RSYNC_HOST_NAME, RSYNC_USER_NAME, RSYNC_REQUEST, and RSYNC_EXIT_STATUS for post-xfer). Commands run via sh -c (Unix) or cmd /C (Windows). Pre-xfer failures deny the transfer with an @error message. Post-xfer failures are logged but do not affect the transfer exit status, matching upstream clientserver.c semantics.
3 of 4 tasks
oferchen
added a commit
that referenced
this pull request
Feb 21, 2026
Add execution logic for the pre-xfer exec and post-xfer exec daemon module directives. The config fields and parsing were added in #2381; this wires up the actual command execution with upstream-compatible environment variables (RSYNC_MODULE_NAME, RSYNC_MODULE_PATH, RSYNC_HOST_ADDR, RSYNC_HOST_NAME, RSYNC_USER_NAME, RSYNC_REQUEST, and RSYNC_EXIT_STATUS for post-xfer). Commands run via sh -c (Unix) or cmd /C (Windows). Pre-xfer failures deny the transfer with an @error message. Post-xfer failures are logged but do not affect the transfer exit status, matching upstream clientserver.c semantics.
oferchen
added a commit
that referenced
this pull request
May 1, 2026
…handling (#2381) Add 11 new per-module configuration directives to the daemon config parser: max_verbosity, ignore_errors, ignore_nonreadable, transfer_logging, log_format, dont_compress, pre_xfer_exec, post_xfer_exec, temp_dir, charset, and forward_lookup. These mirror upstream rsync's rsyncd.conf parameters from loadparm.c. Change unknown directive handling to log a warning and continue instead of returning an error, for both global and per-module sections. This matches upstream rsync's behavior of gracefully ignoring unrecognized directives.
oferchen
added a commit
that referenced
this pull request
May 1, 2026
Add execution logic for the pre-xfer exec and post-xfer exec daemon module directives. The config fields and parsing were added in #2381; this wires up the actual command execution with upstream-compatible environment variables (RSYNC_MODULE_NAME, RSYNC_MODULE_PATH, RSYNC_HOST_ADDR, RSYNC_HOST_NAME, RSYNC_USER_NAME, RSYNC_REQUEST, and RSYNC_EXIT_STATUS for post-xfer). Commands run via sh -c (Unix) or cmd /C (Windows). Pre-xfer failures deny the transfer with an @error message. Post-xfer failures are logged but do not affect the transfer exit status, matching upstream clientserver.c semantics.
oferchen
added a commit
that referenced
this pull request
May 5, 2026
…handling (#2381) Add 11 new per-module configuration directives to the daemon config parser: max_verbosity, ignore_errors, ignore_nonreadable, transfer_logging, log_format, dont_compress, pre_xfer_exec, post_xfer_exec, temp_dir, charset, and forward_lookup. These mirror upstream rsync's rsyncd.conf parameters from loadparm.c. Change unknown directive handling to log a warning and continue instead of returning an error, for both global and per-module sections. This matches upstream rsync's behavior of gracefully ignoring unrecognized directives.
oferchen
added a commit
that referenced
this pull request
May 5, 2026
Add execution logic for the pre-xfer exec and post-xfer exec daemon module directives. The config fields and parsing were added in #2381; this wires up the actual command execution with upstream-compatible environment variables (RSYNC_MODULE_NAME, RSYNC_MODULE_PATH, RSYNC_HOST_ADDR, RSYNC_HOST_NAME, RSYNC_USER_NAME, RSYNC_REQUEST, and RSYNC_EXIT_STATUS for post-xfer). Commands run via sh -c (Unix) or cmd /C (Windows). Pre-xfer failures deny the transfer with an @error message. Post-xfer failures are logged but do not affect the transfer exit status, matching upstream clientserver.c semantics.
5 tasks done
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…ap at delete emitter (ATU-4 #2381) Convert the cursor handoff in `DeleteContext::into_emitter` from `Arc::try_unwrap(self.cursor)` plus `Mutex::into_inner` to a crossbeam-channel producer/consumer pair. Workers (clones of `Arc<DeleteContext>`) call `observe_segment_for_delete` and `observe_directory`, which enqueue an owned `CursorObservation` onto the producer side. The drain (`into_emitter`) takes `self` by value - by Rust ownership rules every Arc clone has been released by that point - then drops the master sender to close the channel and blocks on `rx.recv()` until it returns `Err`. Each observation is folded into a freshly built `DirTraversalCursor`. No `try_unwrap` on the cursor handle; no `Mutex::into_inner` panic on poison. The plan-map side keeps `Arc::try_unwrap`, now wrapped in a `try_unwrap_or_log` helper that emits a structured `tracing::warn!` with strong/weak counts before returning the original `Arc`. This is the documented transition-era fallback for fragile drain sites that have not yet adopted channel-shutdown handoff (per `docs/architecture/drain-error-recovery.md`). Tests added: - `channel_drain_completes_when_workers_drop_normally` - spawns 8 producer threads, joins them all, asserts the drain finishes without blocking and counts every worker observation. - `channel_drain_completes_when_worker_panics_mid_send` - one worker panics inside `catch_unwind` after sending its observation; the drain still completes and the surviving worker's observation is delivered. For tests and diagnostics that want mid-flight cursor inspection, `cursor_snapshot()` drains the channel, replays the observations into a private cursor, then re-enqueues them so the eventual drain still sees the full set. Three internal tests and one transfer-side integration test now access the cursor through that accessor. `DirTraversalCursor` and its `Frame` derive `Clone` so the snapshot helper can rebuild a private view without changing the original. Closes ATU-4 (#2381).
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…ap at delete emitter (ATU-4 #2381) Convert the cursor handoff in `DeleteContext::into_emitter` from `Arc::try_unwrap(self.cursor)` plus `Mutex::into_inner` to a crossbeam-channel producer/consumer pair. Workers (clones of `Arc<DeleteContext>`) call `observe_segment_for_delete` and `observe_directory`, which enqueue an owned `CursorObservation` onto the producer side. The drain (`into_emitter`) takes `self` by value - by Rust ownership rules every Arc clone has been released by that point - then drops the master sender to close the channel and blocks on `rx.recv()` until it returns `Err`. Each observation is folded into a freshly built `DirTraversalCursor`. No `try_unwrap` on the cursor handle; no `Mutex::into_inner` panic on poison. The plan-map side keeps `Arc::try_unwrap`, now wrapped in a `try_unwrap_or_log` helper that emits a structured `tracing::warn!` with strong/weak counts before returning the original `Arc`. This is the documented transition-era fallback for fragile drain sites that have not yet adopted channel-shutdown handoff (per `docs/architecture/drain-error-recovery.md`). Tests added: - `channel_drain_completes_when_workers_drop_normally` - spawns 8 producer threads, joins them all, asserts the drain finishes without blocking and counts every worker observation. - `channel_drain_completes_when_worker_panics_mid_send` - one worker panics inside `catch_unwind` after sending its observation; the drain still completes and the surviving worker's observation is delivered. For tests and diagnostics that want mid-flight cursor inspection, `cursor_snapshot()` drains the channel, replays the observations into a private cursor, then re-enqueues them so the eventual drain still sees the full set. Three internal tests and one transfer-side integration test now access the cursor through that accessor. `DirTraversalCursor` and its `Frame` derive `Clone` so the snapshot helper can rebuild a private view without changing the original. Closes ATU-4 (#2381).
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…ap at delete emitter (ATU-4 #2381) Convert the cursor handoff in `DeleteContext::into_emitter` from `Arc::try_unwrap(self.cursor)` plus `Mutex::into_inner` to a crossbeam-channel producer/consumer pair. Workers (clones of `Arc<DeleteContext>`) call `observe_segment_for_delete` and `observe_directory`, which enqueue an owned `CursorObservation` onto the producer side. The drain (`into_emitter`) takes `self` by value - by Rust ownership rules every Arc clone has been released by that point - then drops the master sender to close the channel and blocks on `rx.recv()` until it returns `Err`. Each observation is folded into a freshly built `DirTraversalCursor`. No `try_unwrap` on the cursor handle; no `Mutex::into_inner` panic on poison. The plan-map side keeps `Arc::try_unwrap`, now wrapped in a `try_unwrap_or_log` helper that emits a structured `tracing::warn!` with strong/weak counts before returning the original `Arc`. This is the documented transition-era fallback for fragile drain sites that have not yet adopted channel-shutdown handoff (per `docs/architecture/drain-error-recovery.md`). Tests added: - `channel_drain_completes_when_workers_drop_normally` - spawns 8 producer threads, joins them all, asserts the drain finishes without blocking and counts every worker observation. - `channel_drain_completes_when_worker_panics_mid_send` - one worker panics inside `catch_unwind` after sending its observation; the drain still completes and the surviving worker's observation is delivered. For tests and diagnostics that want mid-flight cursor inspection, `cursor_snapshot()` drains the channel, replays the observations into a private cursor, then re-enqueues them so the eventual drain still sees the full set. Three internal tests and one transfer-side integration test now access the cursor through that accessor. `DirTraversalCursor` and its `Frame` derive `Clone` so the snapshot helper can rebuild a private view without changing the original. Closes ATU-4 (#2381).
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…ap at delete emitter (ATU-4 #2381) (#4401) Convert the cursor handoff in `DeleteContext::into_emitter` from `Arc::try_unwrap(self.cursor)` plus `Mutex::into_inner` to a crossbeam-channel producer/consumer pair. Workers (clones of `Arc<DeleteContext>`) call `observe_segment_for_delete` and `observe_directory`, which enqueue an owned `CursorObservation` onto the producer side. The drain (`into_emitter`) takes `self` by value - by Rust ownership rules every Arc clone has been released by that point - then drops the master sender to close the channel and blocks on `rx.recv()` until it returns `Err`. Each observation is folded into a freshly built `DirTraversalCursor`. No `try_unwrap` on the cursor handle; no `Mutex::into_inner` panic on poison. The plan-map side keeps `Arc::try_unwrap`, now wrapped in a `try_unwrap_or_log` helper that emits a structured `tracing::warn!` with strong/weak counts before returning the original `Arc`. This is the documented transition-era fallback for fragile drain sites that have not yet adopted channel-shutdown handoff (per `docs/architecture/drain-error-recovery.md`). Tests added: - `channel_drain_completes_when_workers_drop_normally` - spawns 8 producer threads, joins them all, asserts the drain finishes without blocking and counts every worker observation. - `channel_drain_completes_when_worker_panics_mid_send` - one worker panics inside `catch_unwind` after sending its observation; the drain still completes and the surviving worker's observation is delivered. For tests and diagnostics that want mid-flight cursor inspection, `cursor_snapshot()` drains the channel, replays the observations into a private cursor, then re-enqueues them so the eventual drain still sees the full set. Three internal tests and one transfer-side integration test now access the cursor through that accessor. `DirTraversalCursor` and its `Frame` derive `Clone` so the snapshot helper can rebuild a private view without changing the original. Closes ATU-4 (#2381).
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…ap at delete emitter (ATU-4 #2381) (#4401) Convert the cursor handoff in `DeleteContext::into_emitter` from `Arc::try_unwrap(self.cursor)` plus `Mutex::into_inner` to a crossbeam-channel producer/consumer pair. Workers (clones of `Arc<DeleteContext>`) call `observe_segment_for_delete` and `observe_directory`, which enqueue an owned `CursorObservation` onto the producer side. The drain (`into_emitter`) takes `self` by value - by Rust ownership rules every Arc clone has been released by that point - then drops the master sender to close the channel and blocks on `rx.recv()` until it returns `Err`. Each observation is folded into a freshly built `DirTraversalCursor`. No `try_unwrap` on the cursor handle; no `Mutex::into_inner` panic on poison. The plan-map side keeps `Arc::try_unwrap`, now wrapped in a `try_unwrap_or_log` helper that emits a structured `tracing::warn!` with strong/weak counts before returning the original `Arc`. This is the documented transition-era fallback for fragile drain sites that have not yet adopted channel-shutdown handoff (per `docs/architecture/drain-error-recovery.md`). Tests added: - `channel_drain_completes_when_workers_drop_normally` - spawns 8 producer threads, joins them all, asserts the drain finishes without blocking and counts every worker observation. - `channel_drain_completes_when_worker_panics_mid_send` - one worker panics inside `catch_unwind` after sending its observation; the drain still completes and the surviving worker's observation is delivered. For tests and diagnostics that want mid-flight cursor inspection, `cursor_snapshot()` drains the channel, replays the observations into a private cursor, then re-enqueues them so the eventual drain still sees the full set. Three internal tests and one transfer-side integration test now access the cursor through that accessor. `DirTraversalCursor` and its `Frame` derive `Clone` so the snapshot helper can rebuild a private view without changing the original. Closes ATU-4 (#2381).
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…ap at delete emitter (ATU-4 #2381) (#4401) Convert the cursor handoff in `DeleteContext::into_emitter` from `Arc::try_unwrap(self.cursor)` plus `Mutex::into_inner` to a crossbeam-channel producer/consumer pair. Workers (clones of `Arc<DeleteContext>`) call `observe_segment_for_delete` and `observe_directory`, which enqueue an owned `CursorObservation` onto the producer side. The drain (`into_emitter`) takes `self` by value - by Rust ownership rules every Arc clone has been released by that point - then drops the master sender to close the channel and blocks on `rx.recv()` until it returns `Err`. Each observation is folded into a freshly built `DirTraversalCursor`. No `try_unwrap` on the cursor handle; no `Mutex::into_inner` panic on poison. The plan-map side keeps `Arc::try_unwrap`, now wrapped in a `try_unwrap_or_log` helper that emits a structured `tracing::warn!` with strong/weak counts before returning the original `Arc`. This is the documented transition-era fallback for fragile drain sites that have not yet adopted channel-shutdown handoff (per `docs/architecture/drain-error-recovery.md`). Tests added: - `channel_drain_completes_when_workers_drop_normally` - spawns 8 producer threads, joins them all, asserts the drain finishes without blocking and counts every worker observation. - `channel_drain_completes_when_worker_panics_mid_send` - one worker panics inside `catch_unwind` after sending its observation; the drain still completes and the surviving worker's observation is delivered. For tests and diagnostics that want mid-flight cursor inspection, `cursor_snapshot()` drains the channel, replays the observations into a private cursor, then re-enqueues them so the eventual drain still sees the full set. Three internal tests and one transfer-side integration test now access the cursor through that accessor. `DirTraversalCursor` and its `Frame` derive `Clone` so the snapshot helper can rebuild a private view without changing the original. Closes ATU-4 (#2381).
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…ap at delete emitter (ATU-4 #2381) (#4401) Convert the cursor handoff in `DeleteContext::into_emitter` from `Arc::try_unwrap(self.cursor)` plus `Mutex::into_inner` to a crossbeam-channel producer/consumer pair. Workers (clones of `Arc<DeleteContext>`) call `observe_segment_for_delete` and `observe_directory`, which enqueue an owned `CursorObservation` onto the producer side. The drain (`into_emitter`) takes `self` by value - by Rust ownership rules every Arc clone has been released by that point - then drops the master sender to close the channel and blocks on `rx.recv()` until it returns `Err`. Each observation is folded into a freshly built `DirTraversalCursor`. No `try_unwrap` on the cursor handle; no `Mutex::into_inner` panic on poison. The plan-map side keeps `Arc::try_unwrap`, now wrapped in a `try_unwrap_or_log` helper that emits a structured `tracing::warn!` with strong/weak counts before returning the original `Arc`. This is the documented transition-era fallback for fragile drain sites that have not yet adopted channel-shutdown handoff (per `docs/architecture/drain-error-recovery.md`). Tests added: - `channel_drain_completes_when_workers_drop_normally` - spawns 8 producer threads, joins them all, asserts the drain finishes without blocking and counts every worker observation. - `channel_drain_completes_when_worker_panics_mid_send` - one worker panics inside `catch_unwind` after sending its observation; the drain still completes and the surviving worker's observation is delivered. For tests and diagnostics that want mid-flight cursor inspection, `cursor_snapshot()` drains the channel, replays the observations into a private cursor, then re-enqueues them so the eventual drain still sees the full set. Three internal tests and one transfer-side integration test now access the cursor through that accessor. `DirTraversalCursor` and its `Frame` derive `Clone` so the snapshot helper can rebuild a private view without changing the original. Closes ATU-4 (#2381).
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
rsyncd.confparameters fromloadparm.c:max_verbosity(default: 1) — caps client verbosityignore_errors(default: false) — ignore I/O errors during deleteignore_nonreadable(default: false) — skip unreadable filestransfer_logging(default: false) — enable per-file transfer logginglog_format(default:"%o %h [%a] %m (%u) %f %l") — transfer log formatdont_compress— glob patterns of files not to compresspre_xfer_exec/post_xfer_exec— pre/post transfer commandstemp_dir— temporary directory for received filescharset— character set for filename conversionforward_lookup(default: true) — DNS forward lookup verificationTest plan
cargo clippy --workspace --all-targets --all-features --no-deps -- -D warningspassescargo fmt --all -- --checkpasses