pub struct TransferConfig {Show 18 fields
pub compression_level: u32,
pub exclude_patterns: Vec<String>,
pub ssh_server_alive_interval_secs: Option<u64>,
pub ssh_control_persist_secs: Option<u64>,
pub remote_base: String,
pub sync_timeout_ms: Option<u64>,
pub source_sync_silence_timeout_secs: u64,
pub retry: RetryConfig,
pub verify_artifacts: bool,
pub verify_max_size_bytes: u64,
pub max_transfer_mb: Option<u64>,
pub max_transfer_time_ms: Option<u64>,
pub bwlimit_kbps: Option<u64>,
pub rsync_bin: Option<String>,
pub estimated_bandwidth_bps: Option<u64>,
pub adaptive_compression: bool,
pub min_compression_level: u32,
pub max_compression_level: u32,
}Fields§
§compression_level: u32zstd compression level (1-19).
exclude_patterns: Vec<String>Patterns to exclude from transfer.
ssh_server_alive_interval_secs: Option<u64>SSH keepalive interval in seconds (ssh -o ServerAliveInterval=<N>).
When unset, build transfers use 15 seconds. Zero defers to OpenSSH configuration.
ssh_control_persist_secs: Option<u64>SSH ControlPersist idle timeout in seconds (ssh -o ControlPersist=<N>s).
- Unset preserves OpenSSH defaults (ControlPersist enabled by default via mux).
0disables persistence (ControlPersist=no).
remote_base: StringStaging base on the worker for the transfer paths that do NOT mirror
the client’s project layout: --clean-overlay roots, Windows workers,
and rch cache warm. Must be an absolute path; defaults to
default_remote_base (/data/tmp/rch).
An ordinary rch exec does not use this: it mirrors the project under
the worker’s canonical root ([path_topology] canonical_root), and the
pooled Cargo target store rides along inside that mirror. To move
pooled stores onto another filesystem, set
[remediation.pooled_target] store_base (issue #64).
sync_timeout_ms: Option<u64>Per-attempt timeout for source synchronization, in milliseconds.
This is deliberately separate from remote compilation and artifact-return timeouts. When unset, RCH derives a conservative timeout from the source payload size (30 seconds plus one second per MiB, capped at one hour).
source_sync_silence_timeout_secs: u64Silence-based stall timeout for source synchronization, in seconds (issue #59).
Aborts a source sync when rsync emits NO output at all — no progress
refresh, no stats, no itemized line — for this long. This is deliberately
far tighter than the wall-clock sync_timeout_ms cap (which scales with
payload size up to an hour): a large first-time sync keeps refreshing its
progress line and is never killed, while a dead channel or wedged rsync
is detected within this window instead of holding the reservation until
the wall-clock cap. On a stall the hook releases the worker and re-enters
selection excluding it. 0 disables silence detection.
retry: RetryConfigRetry policy for transient network errors during transfer.
verify_artifacts: boolVerify artifact integrity using blake3 hashes after transfer (bd-377q).
When enabled, computes blake3 hashes of key artifacts (binaries, test outputs) on the worker after build, then verifies them locally after download. Disabled by default to avoid extra overhead.
verify_max_size_bytes: u64Maximum file size (bytes) for artifact verification (bd-377q).
Files larger than this limit are skipped during verification to avoid excessive I/O. Defaults to 100MB.
max_transfer_mb: Option<u64>Maximum transfer size in MB before skipping remote execution.
When set, runs rsync --dry-run --stats to estimate transfer size.
If the estimated size exceeds this threshold, remote offload is skipped
and the command runs locally. Set to None (default) to disable.
max_transfer_time_ms: Option<u64>Maximum estimated transfer time in milliseconds before skipping remote.
Uses estimated_bandwidth_bps (or measured link speed) to calculate
expected transfer time. If it exceeds this threshold, remote offload
is skipped. Set to None (default) to disable.
bwlimit_kbps: Option<u64>Bandwidth limit for rsync in KB/s.
Passed as rsync --bwlimit=<N> to limit transfer speed and prevent
network saturation. Set to None or 0 (default) for unlimited.
rsync_bin: Option<String>Explicit rsync binary for every local transfer (issue #66).
Unset (the default) lets rch pick: the PATH rsync when it is a
modern (3.1+) rsync, otherwise a modern rsync from the well-known
Homebrew/MacPorts locations, otherwise the PATH binary driven with the
openrsync/2.6.9-compatible argv. Set this to force one binary
(~ is expanded; a bare name is looked up on PATH). The
RCH_RSYNC_BIN environment variable overrides this setting.
estimated_bandwidth_bps: Option<u64>Estimated link bandwidth in bytes per second.
Used for transfer time estimation when max_transfer_time_ms is set.
If not provided, defaults to 10 MB/s (10485760 bytes/sec).
adaptive_compression: boolEnable adaptive zstd compression based on transfer size (bd-243w).
When enabled, automatically selects compression level based on estimated payload size:
- < 10MB: level 1 (fast, minimal compression)
- 10-200MB: level 3 (balanced, default)
-
200MB: level 7 (slower, better compression)
When disabled (default), uses the fixed compression_level setting.
min_compression_level: u32Minimum compression level for adaptive mode (bd-243w).
Even in adaptive mode, compression level won’t go below this. Defaults to 1.
max_compression_level: u32Maximum compression level for adaptive mode (bd-243w).
Even in adaptive mode, compression level won’t exceed this. Defaults to 9 (avoids CPU-intensive levels 10+).
Implementations§
Source§impl TransferConfig
impl TransferConfig
Sourcepub const MIN_SYNC_TIMEOUT_MS: u64 = 1_000
pub const MIN_SYNC_TIMEOUT_MS: u64 = 1_000
Smallest accepted explicit source-sync timeout (one second).
Sourcepub const MAX_SYNC_TIMEOUT_MS: u64 = 3_600_000
pub const MAX_SYNC_TIMEOUT_MS: u64 = 3_600_000
Largest accepted explicit or derived source-sync timeout (one hour).
Sourcepub const DEFAULT_SYNC_TIMEOUT_FLOOR_MS: u64 = 30_000
pub const DEFAULT_SYNC_TIMEOUT_FLOOR_MS: u64 = 30_000
Fixed floor used by the payload-aware default policy.
Sourcepub fn valid_sync_timeout_ms(value: u64) -> bool
pub fn valid_sync_timeout_ms(value: u64) -> bool
Whether an explicit source-sync timeout is within the supported range.
Sourcepub fn sync_timeout_for_payload(&self, payload_bytes: u64) -> Duration
pub fn sync_timeout_for_payload(&self, payload_bytes: u64) -> Duration
Resolve the per-attempt source-sync timeout for an exact payload size.
Explicit configuration wins. Otherwise the default grants 30 seconds of setup time plus one second per MiB at a conservative 1 MiB/s floor. This prevents a cold, large pinned tree from inheriting the old fixed 30-second ceiling while still bounding every individual attempt.
Sourcepub fn select_compression_level(&self, estimated_bytes: Option<u64>) -> u32
pub fn select_compression_level(&self, estimated_bytes: Option<u64>) -> u32
Select compression level based on estimated transfer size (bd-243w).
When adaptive compression is enabled, selects an appropriate level based on payload size:
- < 10MB: level 1 (fast, minimal compression)
- 10-200MB: level 3 (balanced)
-
200MB: level 7 (better compression)
The result is clamped between min_compression_level and max_compression_level.
When adaptive compression is disabled, returns the fixed compression_level.