Skip to content

docs: clarify retry-max-time timing check and sleep behavior#21411

Closed
dioput12 wants to merge 1 commit into
curl:masterfrom
dioput12:docs-retry-max-time-clarify
Closed

docs: clarify retry-max-time timing check and sleep behavior#21411
dioput12 wants to merge 1 commit into
curl:masterfrom
dioput12:docs-retry-max-time-clarify

Conversation

@dioput12
Copy link
Copy Markdown
Contributor

This change clarifies the documentation for --retry-max-time when used together with --retry and --retry-delay.

The existing text already states that retries continue “as long as the timer has not reached this given limit”, but it does not explicitly mention that the retry timer includes the sleep time between retries (for example due to --retry-delay) and that the limit is checked before starting each new retry.

The new paragraphs make this behavior explicit and also restate that transfers which have already started are allowed to complete even if this makes the total wall clock time exceed the limit, with --max-time available to cap the duration of each individual transfer attempt.

@dioput12
Copy link
Copy Markdown
Contributor Author

My testing script:

#!/usr/bin/env bash
# retry-max-time regression notes for example.invalid
# Run from a shell with curl in PATH.

TARGET="http://example.invalid"

echo "== Baseline: retry-max-time 5 =="
time curl -v \
  --retry 3 \
  --retry-delay 2 \
  --retry-max-time 5 \
  --connect-timeout 2 \
  "$TARGET"

echo
echo "== retry-max-time 3 (expect fewer retries than 5s case) =="
time curl -v \
  --retry 3 \
  --retry-delay 2 \
  --retry-max-time 3 \
  --connect-timeout 2 \
  "$TARGET"

echo
echo "== retry-max-time 1 (only initial attempt + at most one retry) =="
time curl -v \
  --retry 3 \
  --retry-delay 2 \
  --retry-max-time 1 \
  --connect-timeout 2 \
  "$TARGET"

echo
echo "== retry-max-time 10 with max-time 4 (per-attempt limit) =="
time curl -v \
  --retry 3 \
  --retry-delay 2 \
  --retry-max-time 10 \
  --max-time 4 \
  "$TARGET"

@bagder bagder closed this in 37ab246 Apr 22, 2026
@bagder
Copy link
Copy Markdown
Member

bagder commented Apr 22, 2026

Thanks!

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