Skip to content

docs/cmdline-opts/retry.md: mention duplicate data with redirected output - #23670

Closed
heppycat wants to merge 1 commit into
curl:masterfrom
heppycat:docs-retry-redirect
Closed

heppycat wants to merge 1 commit into
curl:masterfrom
heppycat:docs-retry-redirect

Conversation

@heppycat

Copy link
Copy Markdown
Contributor

The --retry-all-errors page warns that a retry cannot undo partial data sent to a pipe or a > redirect, but plain --retry also retries on timeouts, so the same thing happens without --retry-all-errors and the --retry page does not say so.

I hit this downloading byte ranges with curl --retry 5 -r lo-hi -o - >> part: a stalled attempt was retried and the range was appended again after the bytes already written, corrupting the file.

Repro with a server that sends half the body and then stalls on the first request:

curl -s --retry 2 --speed-time 2 --speed-limit 1 http://127.0.0.1:18777/ > out
# out contains ABCDEABCDEFGHIJ instead of ABCDEFGHIJ

This adds a short paragraph to retry.md.

…tput

The warning exists in retry-all-errors.md but plain --retry also retries
on timeouts, so a stall mid-body duplicates data written to stdout.

@bagder bagder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair!

@bagder bagder closed this in 87c4c6d Oct 29, 2026
@bagder

bagder commented Oct 29, 2026

Copy link
Copy Markdown
Member

Thanks, merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants