Skip to content

docs: document retry policy for network errors#150

Open
mre wants to merge 5 commits intomasterfrom
docs/retry-policy-network-errors
Open

docs: document retry policy for network errors#150
mre wants to merge 5 commits intomasterfrom
docs/retry-policy-network-errors

Conversation

@mre
Copy link
Member

@mre mre commented Mar 13, 2026

Closes #149

Summary

The network errors troubleshooting page previously had no information about whether lychee retries failed requests. This PR adds a dedicated Retry Policy section that answers the question from the issue.

Changes

  • New ## Retry Policy section with:
    • A brief explanation of how lychee handles transient vs. permanent errors
    • An SVG-icon table (✓/✗ in green/red) listing exactly which error types are retried, derived directly from lychee-lib/src/retry.rs
    • A ### Configuring retries sub-section documenting --max-retries (default: 3) and --retry-wait-time (default: 1 s) with CLI and TOML examples
  • Added Connection reset by server as an example error message (the exact error from the issue)
  • Minor prose clean-ups throughout the page

mre added 4 commits March 13, 2026 18:25
Closes #149

- Add a 'Retry Policy' section to the Network Errors troubleshooting page
- Include an SVG-icon table listing which error types are retried and which are not
  (based on the logic in lychee-lib/src/retry.rs)
- Document the --max-retries and --retry-wait-time options with their defaults (3 and 1s)
- Add 'Connection reset by server' as an example error message
- Minor wording improvements throughout
@mre mre requested review from katrinafyi and thomas-zahner March 13, 2026 20:53
Copy link
Member

@katrinafyi katrinafyi left a comment

Choose a reason for hiding this comment

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

Looks good. I'm definitely not an expert on network error conditions, but the text looks fine and makes sense. I'm sure it will be helpful.

Comment on lines +46 to +53
| Connection Timeout | <Yes /> | Server didn't respond in time |
| Connection Reset | <Yes /> | Connection dropped unexpectedly |
| Connection Aborted | <Yes /> | Connection terminated mid-request |
| Incomplete Message | <Yes /> | Response cut off before completion |
| 4xx Client Errors | <No /> | 400, 401, 403, 404 (except 408, 429) |
| 2xx Success | <No /> | 200, 201, 204 |
| 3xx Redirects | <No /> | 301, 302 |
| Initial Connection Failure | <No /> | Can't reach server at all |
Copy link
Member

Choose a reason for hiding this comment

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

My networking knowledge is not so good. What's the difference between "Connection Timeout" and "Initial Connection Failure"? What would be an example of both?

Copy link
Member Author

Choose a reason for hiding this comment

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

The key difference is: timeout = eventually gave up waiting, connection failure = immediately told you "no."

Connection timeout means the TCP connection was attempted, and the server acknowledged it (or at least a packet was sent), but the server then stopped responding mid-way and the client gave up waiting. Example: you start a request to https://example.com, the TCP handshake begins, but the server is overloaded and never sends a response back. After a while, lychee gives up.

Initial connection failure means the connection was never established in the first place. For example when trying to connect to https://localhost:9999 where nothing is listening. The OS replies instantly with "connection refused". Or a DNS lookup that returns no result.

Does that answer your question or should I change the wording in the docs?

Copy link
Member

Choose a reason for hiding this comment

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

It does help, thanks! Maybe just add these cases to the examples column for those rows. Calling out DNS specifically would help a lot.

Co-authored-by: Kait <39479354+katrinafyi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retry policy of network errors

2 participants