Repository navigation
Use exec for server mode fallback - #2198
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if let Err(error) = command.exec() { | ||
| let text = format!( | ||
| "failed to launch fallback {upstream_program} binary '{}': {error}", |
There was a problem hiding this comment.
Fix exec error handling to compile on Unix
On Unix builds this new fallback path will not compile: CommandExt::exec returns an io::Error on failure, not a Result, so the pattern if let Err(error) = command.exec() produces E0308 (expected Error, found Result). Because this block is compiled for all non-test Unix targets, the crate now fails to build at all; handle the returned io::Error directly instead of matching on Err.
Useful? React with 👍 / 👎.
Adds INC_RECURSE diagnostic counter I3 (#2198): a process-global AtomicU64 that tracks every writer.flush() invocation on the generator transfer hot path so operators can quantify flush-per-file and flush-per-batch overhead under inc_recursive sends. The counter is bumped from a single flush_with_count() helper, replacing the five hot-path writer.flush() sites in run_transfer_loop(): - per-iteration flush before reading the next NDX request - NDX_DONE echo on the INC_RECURSE flist-free path - NDX_DONE echo on phase transitions - per-file flush on the dry-run write path - final NDX_DONE goodbye flush at end of loop End-of-loop, end-of-transfer flushes outside the hot path (send_stats, handle_goodbye, the pre-recv_filter_list flush in run()) are left untouched - they fire at most once per transfer and would dilute the per-file ratio. Totals are sampled in GeneratorContext::run via flush_rate_totals() in the same finalize block used by the I1 first-byte probe and emitted via: - debug_log!(Send, 1, ...) for human output - tracing::debug!(target = "rsync::generator::flush_rate", ...) when the optional tracing feature is enabled Public API: a new flush_rate_totals() free function in the generator module. No CLI flag, no wire-format change, no change to the existing hot-path function signatures. Two unit tests cover the counter behaviour: - flush_with_count_increments_global_counter asserts the counter grows by at least N after N flush_with_count() calls (>= guards against concurrent test runs incrementing the shared counter) - flush_rate_totals_is_observable_without_flushing asserts the counter does not move when only the snapshot reader is called, confirming constructing a generator does not bump the counter on its own upstream: sender.c send_files() per-iteration io_flush before recv_ndx Closes #2198
Adds INC_RECURSE diagnostic counter I3 (#2198): a process-global AtomicU64 that tracks every writer.flush() invocation on the generator transfer hot path so operators can quantify flush-per-file and flush-per-batch overhead under inc_recursive sends. The counter is bumped from a single flush_with_count() helper, replacing the five hot-path writer.flush() sites in run_transfer_loop(): - per-iteration flush before reading the next NDX request - NDX_DONE echo on the INC_RECURSE flist-free path - NDX_DONE echo on phase transitions - per-file flush on the dry-run write path - final NDX_DONE goodbye flush at end of loop End-of-loop, end-of-transfer flushes outside the hot path (send_stats, handle_goodbye, the pre-recv_filter_list flush in run()) are left untouched - they fire at most once per transfer and would dilute the per-file ratio. Totals are sampled in GeneratorContext::run via flush_rate_totals() in the same finalize block used by the I1 first-byte probe and emitted via: - debug_log!(Send, 1, ...) for human output - tracing::debug!(target = "rsync::generator::flush_rate", ...) when the optional tracing feature is enabled Public API: a new flush_rate_totals() free function in the generator module. No CLI flag, no wire-format change, no change to the existing hot-path function signatures. Two unit tests cover the counter behaviour: - flush_with_count_increments_global_counter asserts the counter grows by at least N after N flush_with_count() calls (>= guards against concurrent test runs incrementing the shared counter) - flush_rate_totals_is_observable_without_flushing asserts the counter does not move when only the snapshot reader is called, confirming constructing a generator does not bump the counter on its own upstream: sender.c send_files() per-iteration io_flush before recv_ndx Closes #2198
* feat(transfer): instrument writer.flush rate (INC_RECURSE I3) Adds INC_RECURSE diagnostic counter I3 (#2198): a process-global AtomicU64 that tracks every writer.flush() invocation on the generator transfer hot path so operators can quantify flush-per-file and flush-per-batch overhead under inc_recursive sends. The counter is bumped from a single flush_with_count() helper, replacing the five hot-path writer.flush() sites in run_transfer_loop(): - per-iteration flush before reading the next NDX request - NDX_DONE echo on the INC_RECURSE flist-free path - NDX_DONE echo on phase transitions - per-file flush on the dry-run write path - final NDX_DONE goodbye flush at end of loop End-of-loop, end-of-transfer flushes outside the hot path (send_stats, handle_goodbye, the pre-recv_filter_list flush in run()) are left untouched - they fire at most once per transfer and would dilute the per-file ratio. Totals are sampled in GeneratorContext::run via flush_rate_totals() in the same finalize block used by the I1 first-byte probe and emitted via: - debug_log!(Send, 1, ...) for human output - tracing::debug!(target = "rsync::generator::flush_rate", ...) when the optional tracing feature is enabled Public API: a new flush_rate_totals() free function in the generator module. No CLI flag, no wire-format change, no change to the existing hot-path function signatures. Two unit tests cover the counter behaviour: - flush_with_count_increments_global_counter asserts the counter grows by at least N after N flush_with_count() calls (>= guards against concurrent test runs incrementing the shared counter) - flush_rate_totals_is_observable_without_flushing asserts the counter does not move when only the snapshot reader is called, confirming constructing a generator does not bump the counter on its own upstream: sender.c send_files() per-iteration io_flush before recv_ndx Closes #2198 * ci: trigger workflow * ci: trigger workflow
* feat(transfer): instrument writer.flush rate (INC_RECURSE I3) Adds INC_RECURSE diagnostic counter I3 (#2198): a process-global AtomicU64 that tracks every writer.flush() invocation on the generator transfer hot path so operators can quantify flush-per-file and flush-per-batch overhead under inc_recursive sends. The counter is bumped from a single flush_with_count() helper, replacing the five hot-path writer.flush() sites in run_transfer_loop(): - per-iteration flush before reading the next NDX request - NDX_DONE echo on the INC_RECURSE flist-free path - NDX_DONE echo on phase transitions - per-file flush on the dry-run write path - final NDX_DONE goodbye flush at end of loop End-of-loop, end-of-transfer flushes outside the hot path (send_stats, handle_goodbye, the pre-recv_filter_list flush in run()) are left untouched - they fire at most once per transfer and would dilute the per-file ratio. Totals are sampled in GeneratorContext::run via flush_rate_totals() in the same finalize block used by the I1 first-byte probe and emitted via: - debug_log!(Send, 1, ...) for human output - tracing::debug!(target = "rsync::generator::flush_rate", ...) when the optional tracing feature is enabled Public API: a new flush_rate_totals() free function in the generator module. No CLI flag, no wire-format change, no change to the existing hot-path function signatures. Two unit tests cover the counter behaviour: - flush_with_count_increments_global_counter asserts the counter grows by at least N after N flush_with_count() calls (>= guards against concurrent test runs incrementing the shared counter) - flush_rate_totals_is_observable_without_flushing asserts the counter does not move when only the snapshot reader is called, confirming constructing a generator does not bump the counter on its own upstream: sender.c send_files() per-iteration io_flush before recv_ndx Closes #2198 * ci: trigger workflow * ci: trigger workflow
* feat(transfer): instrument writer.flush rate (INC_RECURSE I3) Adds INC_RECURSE diagnostic counter I3 (#2198): a process-global AtomicU64 that tracks every writer.flush() invocation on the generator transfer hot path so operators can quantify flush-per-file and flush-per-batch overhead under inc_recursive sends. The counter is bumped from a single flush_with_count() helper, replacing the five hot-path writer.flush() sites in run_transfer_loop(): - per-iteration flush before reading the next NDX request - NDX_DONE echo on the INC_RECURSE flist-free path - NDX_DONE echo on phase transitions - per-file flush on the dry-run write path - final NDX_DONE goodbye flush at end of loop End-of-loop, end-of-transfer flushes outside the hot path (send_stats, handle_goodbye, the pre-recv_filter_list flush in run()) are left untouched - they fire at most once per transfer and would dilute the per-file ratio. Totals are sampled in GeneratorContext::run via flush_rate_totals() in the same finalize block used by the I1 first-byte probe and emitted via: - debug_log!(Send, 1, ...) for human output - tracing::debug!(target = "rsync::generator::flush_rate", ...) when the optional tracing feature is enabled Public API: a new flush_rate_totals() free function in the generator module. No CLI flag, no wire-format change, no change to the existing hot-path function signatures. Two unit tests cover the counter behaviour: - flush_with_count_increments_global_counter asserts the counter grows by at least N after N flush_with_count() calls (>= guards against concurrent test runs incrementing the shared counter) - flush_rate_totals_is_observable_without_flushing asserts the counter does not move when only the snapshot reader is called, confirming constructing a generator does not bump the counter on its own upstream: sender.c send_files() per-iteration io_flush before recv_ndx Closes #2198 * ci: trigger workflow * ci: trigger workflow
* feat(transfer): instrument writer.flush rate (INC_RECURSE I3) Adds INC_RECURSE diagnostic counter I3 (#2198): a process-global AtomicU64 that tracks every writer.flush() invocation on the generator transfer hot path so operators can quantify flush-per-file and flush-per-batch overhead under inc_recursive sends. The counter is bumped from a single flush_with_count() helper, replacing the five hot-path writer.flush() sites in run_transfer_loop(): - per-iteration flush before reading the next NDX request - NDX_DONE echo on the INC_RECURSE flist-free path - NDX_DONE echo on phase transitions - per-file flush on the dry-run write path - final NDX_DONE goodbye flush at end of loop End-of-loop, end-of-transfer flushes outside the hot path (send_stats, handle_goodbye, the pre-recv_filter_list flush in run()) are left untouched - they fire at most once per transfer and would dilute the per-file ratio. Totals are sampled in GeneratorContext::run via flush_rate_totals() in the same finalize block used by the I1 first-byte probe and emitted via: - debug_log!(Send, 1, ...) for human output - tracing::debug!(target = "rsync::generator::flush_rate", ...) when the optional tracing feature is enabled Public API: a new flush_rate_totals() free function in the generator module. No CLI flag, no wire-format change, no change to the existing hot-path function signatures. Two unit tests cover the counter behaviour: - flush_with_count_increments_global_counter asserts the counter grows by at least N after N flush_with_count() calls (>= guards against concurrent test runs incrementing the shared counter) - flush_rate_totals_is_observable_without_flushing asserts the counter does not move when only the snapshot reader is called, confirming constructing a generator does not bump the counter on its own upstream: sender.c send_files() per-iteration io_flush before recv_ndx Closes #2198 * ci: trigger workflow * ci: trigger workflow
* feat(transfer): instrument writer.flush rate (INC_RECURSE I3) Adds INC_RECURSE diagnostic counter I3 (#2198): a process-global AtomicU64 that tracks every writer.flush() invocation on the generator transfer hot path so operators can quantify flush-per-file and flush-per-batch overhead under inc_recursive sends. The counter is bumped from a single flush_with_count() helper, replacing the five hot-path writer.flush() sites in run_transfer_loop(): - per-iteration flush before reading the next NDX request - NDX_DONE echo on the INC_RECURSE flist-free path - NDX_DONE echo on phase transitions - per-file flush on the dry-run write path - final NDX_DONE goodbye flush at end of loop End-of-loop, end-of-transfer flushes outside the hot path (send_stats, handle_goodbye, the pre-recv_filter_list flush in run()) are left untouched - they fire at most once per transfer and would dilute the per-file ratio. Totals are sampled in GeneratorContext::run via flush_rate_totals() in the same finalize block used by the I1 first-byte probe and emitted via: - debug_log!(Send, 1, ...) for human output - tracing::debug!(target = "rsync::generator::flush_rate", ...) when the optional tracing feature is enabled Public API: a new flush_rate_totals() free function in the generator module. No CLI flag, no wire-format change, no change to the existing hot-path function signatures. Two unit tests cover the counter behaviour: - flush_with_count_increments_global_counter asserts the counter grows by at least N after N flush_with_count() calls (>= guards against concurrent test runs incrementing the shared counter) - flush_rate_totals_is_observable_without_flushing asserts the counter does not move when only the snapshot reader is called, confirming constructing a generator does not bump the counter on its own upstream: sender.c send_files() per-iteration io_flush before recv_ndx Closes #2198 * ci: trigger workflow * ci: trigger workflow
Summary
Testing
[Codex Task](