Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry only on certain HTTP codes #368

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Retry only on certain HTTP codes #368

wants to merge 1 commit into from

Conversation

pabl0
Copy link

@pabl0 pabl0 commented Dec 14, 2023

This is an attempt to fix #332 in a simple manner (not using anything fancy like urllib3.Retry). I think it should improve d/l performance significantly on datasets with large amounts of 404 images, but I have not done a lot of benchmarking.

I haven't found any best practices (like RFCs) wrt what HTTP codes to retry, but the following should be a reasonable list:

  • 408 Request Timeout
  • 429 Too Many Requests (respect the Retry-After header if it's in seconds and less than 10)
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable
  • 504 Gateway Timeout

408 Request Timeout
429 Too Many Requests
    (respect the Retry-After header if it's in seconds and less than 10)
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
@rom1504
Copy link
Owner

rom1504 commented Dec 14, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting for user input
Development

Successfully merging this pull request may close these issues.

Do not retry 404 links
2 participants