feat(progress): render stalled-transfer remaining-time as upstream#4076
Merged
Conversation
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
…ed-transfer-output-2202
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
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
RemainingTimeEstimatoris primed but the window shows zero bytes over the retained samples (a stalled transfer), returnSome(0.0)so the line renders as0:00:00instead of??:??:??. Mirrors upstream'sremain = rate ? ... : 0.0collapse inprogress.c:105(upstream rsync 3.4.1).Some(0.0)branch so a degenerate window never produces a placeholder that upstream would never emit.[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).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(theremain = rate ? ... : 0.0ternary that produces upstream's stall output).Test plan
stall_mid_transfer_renders_as_upstream,stall_then_recovery_returns_live_etaincrates/cli/src/frontend/progress/format/remaining.rs