Repository navigation
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".
| #![deny(unsafe_code)] | ||
|
|
||
| use std::ffi::{OsStr, OsString}; | ||
|
|
||
| fn capacity_hint_for_osstring(hint: usize, overhead: usize) -> usize { | ||
| const MAX_HINT: usize = 1024; | ||
| hint.saturating_add(overhead).min(MAX_HINT) | ||
| } | ||
|
|
||
| /// Wraps daemon wrapper invocations so they behave like `program --daemon ARGS...`. | ||
| /// | ||
| /// The helper mirrors upstream symlink launchers where the daemon binary is an | ||
| /// alias for the client with an implicit `--daemon`. When no program name is | ||
| /// provided the supplied `fallback_program` is used so downstream banners remain | ||
| /// deterministic. | ||
| #[must_use] | ||
| pub fn wrap_daemon_arguments<I, S>(arguments: I, fallback_program: &str) -> Vec<OsString> | ||
| where | ||
| I: IntoIterator<Item = S>, | ||
| S: Into<OsString>, | ||
| { | ||
| let mut iter = arguments.into_iter(); | ||
| let (lower_bound, upper_bound) = iter.size_hint(); | ||
| let program = iter | ||
| .next() | ||
| .map(Into::into) | ||
| .unwrap_or_else(|| OsString::from(fallback_program)); | ||
|
|
||
| let rest_capacity = upper_bound.unwrap_or(lower_bound); | ||
| let mut forwarded = Vec::with_capacity(capacity_hint_for_osstring(rest_capacity, 2)); | ||
| forwarded.push(program); | ||
|
|
||
| let mut rest = Vec::with_capacity(capacity_hint_for_osstring(rest_capacity, 0)); | ||
| let mut saw_daemon_flag = false; | ||
| let mut reached_double_dash = false; | ||
|
|
||
| for argument in iter { | ||
| let argument = argument.into(); | ||
| if !reached_double_dash { | ||
| let value = argument.as_os_str(); |
There was a problem hiding this comment.
Dropping daemon wrapper breaks rsyncd/oc-rsyncd invocation semantics
Removing src/bin/daemon_wrapper.rs eliminates the only logic that injected a --daemon flag when the program was executed via the rsyncd/oc-rsyncd aliases. After this change the workspace builds only oc-rsync, and nothing else inspects the invoked program name to add --daemon. The CLI still only switches into daemon mode when --daemon already appears in the argv (see daemon_mode_arguments), so running a compatibility symlink like rsyncd now just launches the client path instead of the daemon. Existing service scripts or users relying on the standard “invoke rsyncd without flags” convention will no longer start the daemon and will fail with “missing operands” usage errors. Consider keeping the wrapper behaviour (e.g. detect rsyncd/oc-rsyncd in client::run_with and prepend --daemon) if these aliases are meant to remain drop-in replacements.
Useful? React with 👍 / 👎.
Adds the standalone limiter type defined by the design RFC at docs/design/aimd-concurrency-limiter.md. The implementation lives in crates/engine/src/concurrent_delta/work_queue/limiter.rs and exposes: - LimiterConfig builder with min_limit / max_limit / alpha / beta_num / beta_den / build(). - AimdLimiter with try_acquire, target, in_flight, rtt_ema_nanos, and a pub is_rtt_spike predicate. - RAII Ticket guard (#[must_use]) with record_success / record_overload / record_error and Drop fallback for panic paths. - OverloadReason variants for RttSpike / QueueSaturated / DiskCommitPressure / ErrorRate. Internals follow the RFC: integer-only RTT EMA (alpha_ema = 1/8 per RFC 6298), variance smoothed with beta = 1/4, RTT-spike threshold of ema + 2*sqrt(var) via Newton-method isqrt, slow-start doubling until the first decrease, debounce window of 2*rtt_ema after each multiplicative decrease, and AcqRel/Acquire atomic ordering on every target/in_flight transition. Twelve unit tests cover the algorithm: target saturation (single threaded and under thread contention), additive increase, multiplicative decrease, min/max clamps, debounce suppression, RTT EMA convergence, ticket Drop on panic, transient-vs-deterministic error classification, slow-start doubling, RTT-spike predicate, builder clamps, and the isqrt helper. Not yet integrated. Callers (WorkQueueSender, disk-commit, CLI) are wired in the follow-on tickets: - #2092: convergence tests under injected error. - #2093: --adaptive-concurrency / --no-adaptive-concurrency CLI flag.
* feat(engine): AIMD concurrency limiter type (#2091) Adds the standalone limiter type defined by the design RFC at docs/design/aimd-concurrency-limiter.md. The implementation lives in crates/engine/src/concurrent_delta/work_queue/limiter.rs and exposes: - LimiterConfig builder with min_limit / max_limit / alpha / beta_num / beta_den / build(). - AimdLimiter with try_acquire, target, in_flight, rtt_ema_nanos, and a pub is_rtt_spike predicate. - RAII Ticket guard (#[must_use]) with record_success / record_overload / record_error and Drop fallback for panic paths. - OverloadReason variants for RttSpike / QueueSaturated / DiskCommitPressure / ErrorRate. Internals follow the RFC: integer-only RTT EMA (alpha_ema = 1/8 per RFC 6298), variance smoothed with beta = 1/4, RTT-spike threshold of ema + 2*sqrt(var) via Newton-method isqrt, slow-start doubling until the first decrease, debounce window of 2*rtt_ema after each multiplicative decrease, and AcqRel/Acquire atomic ordering on every target/in_flight transition. Twelve unit tests cover the algorithm: target saturation (single threaded and under thread contention), additive increase, multiplicative decrease, min/max clamps, debounce suppression, RTT EMA convergence, ticket Drop on panic, transient-vs-deterministic error classification, slow-start doubling, RTT-spike predicate, builder clamps, and the isqrt helper. Not yet integrated. Callers (WorkQueueSender, disk-commit, CLI) are wired in the follow-on tickets: - #2092: convergence tests under injected error. - #2093: --adaptive-concurrency / --no-adaptive-concurrency CLI flag. * style: cargo fmt --all * fix(engine): clippy lints on AIMD limiter (abs_diff, div_ceil, format args)
…2093) Add convergence tests for the AIMD adaptive-concurrency limiter: - Alternating success/overload stabilizes target within bounded range - Sustained successes grow target monotonically - Debounce window expires after 2 * rtt_ema - Slow-start doubles over multiple windows - Overload during slow-start transitions to additive growth Add --adaptive-concurrency / --no-adaptive-concurrency CLI flag pair, wired through ParsedArgs -> ConfigInputs -> ClientConfigBuilder -> ClientConfig -> WriteConfig. Default is disabled (opt-in).
…2093) Add convergence tests for the AIMD adaptive-concurrency limiter: - Alternating success/overload stabilizes target within bounded range - Sustained successes grow target monotonically - Debounce window expires after 2 * rtt_ema - Slow-start doubles over multiple windows - Overload during slow-start transitions to additive growth Add --adaptive-concurrency / --no-adaptive-concurrency CLI flag pair, wired through ParsedArgs -> ConfigInputs -> ClientConfigBuilder -> ClientConfig -> WriteConfig. Default is disabled (opt-in).
…2093) (#3961) Add convergence tests for the AIMD adaptive-concurrency limiter: - Alternating success/overload stabilizes target within bounded range - Sustained successes grow target monotonically - Debounce window expires after 2 * rtt_ema - Slow-start doubles over multiple windows - Overload during slow-start transitions to additive growth Add --adaptive-concurrency / --no-adaptive-concurrency CLI flag pair, wired through ParsedArgs -> ConfigInputs -> ClientConfigBuilder -> ClientConfig -> WriteConfig. Default is disabled (opt-in).
#2092) (#3987) Add 12 convergence tests exercising the AIMD limiter under error injection scenarios: recovery after error bursts, constant error rate convergence, oscillation amplitude bounding, bounds invariant under pseudo-random patterns, interleaved overload reasons, alpha/beta parameter sensitivity, debounce cascade prevention, transient error burst with recovery, and concurrent multi-threaded error injection.
* test: add AIMD convergence tests under error injection (#2092) Drives the token-bucket bandwidth limiter through an Additive-Increase/Multiplicative-Decrease control loop and verifies the observed throughput tracks the configured rate at every stage: steady state under no errors, multiplicative decrease on simulated error, recovery via additive increase, stability under intermittent errors, and clamping at the minimum rate floor. All assertions use the deterministic recorded sleep durations from the test-support infrastructure to remain free of wall-clock flakiness. * style: apply cargo fmt to aimd convergence tests
* feat(engine): AIMD concurrency limiter type (#2091) Adds the standalone limiter type defined by the design RFC at docs/design/aimd-concurrency-limiter.md. The implementation lives in crates/engine/src/concurrent_delta/work_queue/limiter.rs and exposes: - LimiterConfig builder with min_limit / max_limit / alpha / beta_num / beta_den / build(). - AimdLimiter with try_acquire, target, in_flight, rtt_ema_nanos, and a pub is_rtt_spike predicate. - RAII Ticket guard (#[must_use]) with record_success / record_overload / record_error and Drop fallback for panic paths. - OverloadReason variants for RttSpike / QueueSaturated / DiskCommitPressure / ErrorRate. Internals follow the RFC: integer-only RTT EMA (alpha_ema = 1/8 per RFC 6298), variance smoothed with beta = 1/4, RTT-spike threshold of ema + 2*sqrt(var) via Newton-method isqrt, slow-start doubling until the first decrease, debounce window of 2*rtt_ema after each multiplicative decrease, and AcqRel/Acquire atomic ordering on every target/in_flight transition. Twelve unit tests cover the algorithm: target saturation (single threaded and under thread contention), additive increase, multiplicative decrease, min/max clamps, debounce suppression, RTT EMA convergence, ticket Drop on panic, transient-vs-deterministic error classification, slow-start doubling, RTT-spike predicate, builder clamps, and the isqrt helper. Not yet integrated. Callers (WorkQueueSender, disk-commit, CLI) are wired in the follow-on tickets: - #2092: convergence tests under injected error. - #2093: --adaptive-concurrency / --no-adaptive-concurrency CLI flag. * style: cargo fmt --all * fix(engine): clippy lints on AIMD limiter (abs_diff, div_ceil, format args)
…2093) (#3961) Add convergence tests for the AIMD adaptive-concurrency limiter: - Alternating success/overload stabilizes target within bounded range - Sustained successes grow target monotonically - Debounce window expires after 2 * rtt_ema - Slow-start doubles over multiple windows - Overload during slow-start transitions to additive growth Add --adaptive-concurrency / --no-adaptive-concurrency CLI flag pair, wired through ParsedArgs -> ConfigInputs -> ClientConfigBuilder -> ClientConfig -> WriteConfig. Default is disabled (opt-in).
#2092) (#3987) Add 12 convergence tests exercising the AIMD limiter under error injection scenarios: recovery after error bursts, constant error rate convergence, oscillation amplitude bounding, bounds invariant under pseudo-random patterns, interleaved overload reasons, alpha/beta parameter sensitivity, debounce cascade prevention, transient error burst with recovery, and concurrent multi-threaded error injection.
* test: add AIMD convergence tests under error injection (#2092) Drives the token-bucket bandwidth limiter through an Additive-Increase/Multiplicative-Decrease control loop and verifies the observed throughput tracks the configured rate at every stage: steady state under no errors, multiplicative decrease on simulated error, recovery via additive increase, stability under intermittent errors, and clamping at the minimum rate floor. All assertions use the deterministic recorded sleep durations from the test-support infrastructure to remain free of wall-clock flakiness. * style: apply cargo fmt to aimd convergence tests
…2093) (#3961) Add convergence tests for the AIMD adaptive-concurrency limiter: - Alternating success/overload stabilizes target within bounded range - Sustained successes grow target monotonically - Debounce window expires after 2 * rtt_ema - Slow-start doubles over multiple windows - Overload during slow-start transitions to additive growth Add --adaptive-concurrency / --no-adaptive-concurrency CLI flag pair, wired through ParsedArgs -> ConfigInputs -> ClientConfigBuilder -> ClientConfig -> WriteConfig. Default is disabled (opt-in).
#2092) (#3987) Add 12 convergence tests exercising the AIMD limiter under error injection scenarios: recovery after error bursts, constant error rate convergence, oscillation amplitude bounding, bounds invariant under pseudo-random patterns, interleaved overload reasons, alpha/beta parameter sensitivity, debounce cascade prevention, transient error burst with recovery, and concurrent multi-threaded error injection.
* test: add AIMD convergence tests under error injection (#2092) Drives the token-bucket bandwidth limiter through an Additive-Increase/Multiplicative-Decrease control loop and verifies the observed throughput tracks the configured rate at every stage: steady state under no errors, multiplicative decrease on simulated error, recovery via additive increase, stability under intermittent errors, and clamping at the minimum rate floor. All assertions use the deterministic recorded sleep durations from the test-support infrastructure to remain free of wall-clock flakiness. * style: apply cargo fmt to aimd convergence tests
* feat(engine): AIMD concurrency limiter type (#2091) Adds the standalone limiter type defined by the design RFC at docs/design/aimd-concurrency-limiter.md. The implementation lives in crates/engine/src/concurrent_delta/work_queue/limiter.rs and exposes: - LimiterConfig builder with min_limit / max_limit / alpha / beta_num / beta_den / build(). - AimdLimiter with try_acquire, target, in_flight, rtt_ema_nanos, and a pub is_rtt_spike predicate. - RAII Ticket guard (#[must_use]) with record_success / record_overload / record_error and Drop fallback for panic paths. - OverloadReason variants for RttSpike / QueueSaturated / DiskCommitPressure / ErrorRate. Internals follow the RFC: integer-only RTT EMA (alpha_ema = 1/8 per RFC 6298), variance smoothed with beta = 1/4, RTT-spike threshold of ema + 2*sqrt(var) via Newton-method isqrt, slow-start doubling until the first decrease, debounce window of 2*rtt_ema after each multiplicative decrease, and AcqRel/Acquire atomic ordering on every target/in_flight transition. Twelve unit tests cover the algorithm: target saturation (single threaded and under thread contention), additive increase, multiplicative decrease, min/max clamps, debounce suppression, RTT EMA convergence, ticket Drop on panic, transient-vs-deterministic error classification, slow-start doubling, RTT-spike predicate, builder clamps, and the isqrt helper. Not yet integrated. Callers (WorkQueueSender, disk-commit, CLI) are wired in the follow-on tickets: - #2092: convergence tests under injected error. - #2093: --adaptive-concurrency / --no-adaptive-concurrency CLI flag. * style: cargo fmt --all * fix(engine): clippy lints on AIMD limiter (abs_diff, div_ceil, format args)
…2093) (#3961) Add convergence tests for the AIMD adaptive-concurrency limiter: - Alternating success/overload stabilizes target within bounded range - Sustained successes grow target monotonically - Debounce window expires after 2 * rtt_ema - Slow-start doubles over multiple windows - Overload during slow-start transitions to additive growth Add --adaptive-concurrency / --no-adaptive-concurrency CLI flag pair, wired through ParsedArgs -> ConfigInputs -> ClientConfigBuilder -> ClientConfig -> WriteConfig. Default is disabled (opt-in).
#2092) (#3987) Add 12 convergence tests exercising the AIMD limiter under error injection scenarios: recovery after error bursts, constant error rate convergence, oscillation amplitude bounding, bounds invariant under pseudo-random patterns, interleaved overload reasons, alpha/beta parameter sensitivity, debounce cascade prevention, transient error burst with recovery, and concurrent multi-threaded error injection.
* test: add AIMD convergence tests under error injection (#2092) Drives the token-bucket bandwidth limiter through an Additive-Increase/Multiplicative-Decrease control loop and verifies the observed throughput tracks the configured rate at every stage: steady state under no errors, multiplicative decrease on simulated error, recovery via additive increase, stability under intermittent errors, and clamping at the minimum rate floor. All assertions use the deterministic recorded sleep durations from the test-support infrastructure to remain free of wall-clock flakiness. * style: apply cargo fmt to aimd convergence tests
Summary
rsync,rsyncd, andoc-rsyncdbinary entry points so the workspace only buildsoc-rsynclegacy-binariesfeature and updating tests, manifests, and docs to reflect the new branding contractTesting
[Codex Task](