Skip to content

feat(progress): render stalled-transfer remaining-time as upstream#4076

Merged
oferchen merged 2 commits into
masterfrom
feat/progress-stalled-transfer-output-2202
May 15, 2026
Merged

feat(progress): render stalled-transfer remaining-time as upstream#4076
oferchen merged 2 commits into
masterfrom
feat/progress-stalled-transfer-output-2202

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • When RemainingTimeEstimator is primed but the window shows zero bytes over the retained samples (a stalled transfer), return Some(0.0) so the line renders as 0:00:00 instead of ??:??:??. Mirrors upstream's remain = rate ? ... : 0.0 collapse in progress.c:105 (upstream rsync 3.4.1).
  • Cover the elapsed-zero and zero-rate guards with the same Some(0.0) branch so a degenerate window never produces a placeholder that upstream would never emit.
  • Add unit tests for the stall mid-transfer case ([100, 100, 100] over [t=1, t=2, t=3] -> 0:00:00) and post-stall recovery (window flushes, ETA returns to a live value).
  • Update docs/audits/progress-line-format-audit.md: add section 4a and mark D7 RESOLVED.

Closes #2202.

Reference: target/interop/upstream-src/rsync-3.4.1/progress.c:105 (the remain = rate ? ... : 0.0 ternary that produces upstream's stall output).

Test plan

  • CI: fmt + clippy
  • CI: nextest (stable, beta, nightly)
  • CI: Linux musl / macOS / Windows matrices
  • New unit tests: stall_mid_transfer_renders_as_upstream, stall_then_recovery_returns_live_eta in crates/cli/src/frontend/progress/format/remaining.rs

When the sliding-window estimator is primed but the latest samples
show zero bytes-per-second over the window (network stalled, sender
paused), upstream collapses `remain = rate ? ... : 0.0` to `0.0`,
which renders as `0:00:00` rather than the `??:??:??` placeholder
(progress.c:105). Previously we returned `None` and rendered
`??:??:??`, diverging from upstream. Update `remaining_seconds` to
return `Some(0.0)` for the stall (and the elapsed=0 / rate=0 guard
branches) so the rendered line matches upstream byte-for-byte.

Adds unit tests for the stall mid-transfer case and post-stall
recovery. Marks D7 RESOLVED in the progress-line-format audit.

upstream: progress.c:102-125 rprint_progress
@github-actions github-actions Bot added the enhancement New feature or request label May 14, 2026
@oferchen oferchen merged commit fc700c1 into master May 15, 2026
43 of 45 checks passed
@oferchen oferchen deleted the feat/progress-stalled-transfer-output-2202 branch May 16, 2026 19:50
oferchen added a commit that referenced this pull request May 18, 2026
…4076)

When the sliding-window estimator is primed but the latest samples
show zero bytes-per-second over the window (network stalled, sender
paused), upstream collapses `remain = rate ? ... : 0.0` to `0.0`,
which renders as `0:00:00` rather than the `??:??:??` placeholder
(progress.c:105). Previously we returned `None` and rendered
`??:??:??`, diverging from upstream. Update `remaining_seconds` to
return `Some(0.0)` for the stall (and the elapsed=0 / rate=0 guard
branches) so the rendered line matches upstream byte-for-byte.

Adds unit tests for the stall mid-transfer case and post-stall
recovery. Marks D7 RESOLVED in the progress-line-format audit.

upstream: progress.c:102-125 rprint_progress
oferchen added a commit that referenced this pull request May 18, 2026
…4076)

When the sliding-window estimator is primed but the latest samples
show zero bytes-per-second over the window (network stalled, sender
paused), upstream collapses `remain = rate ? ... : 0.0` to `0.0`,
which renders as `0:00:00` rather than the `??:??:??` placeholder
(progress.c:105). Previously we returned `None` and rendered
`??:??:??`, diverging from upstream. Update `remaining_seconds` to
return `Some(0.0)` for the stall (and the elapsed=0 / rate=0 guard
branches) so the rendered line matches upstream byte-for-byte.

Adds unit tests for the stall mid-transfer case and post-stall
recovery. Marks D7 RESOLVED in the progress-line-format audit.

upstream: progress.c:102-125 rprint_progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant