Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions news/4473.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pip now retries on more HTTP status codes, for intermittent failures.

Previously, it only retried on the standard 503. Now, it also retries on 500
(transient failures on AWS S3), 520 and 527 (transient failures on Cloudflare).
4 changes: 3 additions & 1 deletion src/pip/_internal/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,9 @@ def __init__(self, *args, **kwargs):
# connection got interrupted in some way. A 503 error in general
# is typically considered a transient error so we'll go ahead and
# retry it.
status_forcelist=[503],
# A 500 may indicate transient errror in Amazon S3
# A 520 or 527 - may indicate transient errror in CloudFlare
status_forcelist=[500, 503, 520, 527],

# Add a small amount of back off between failed requests in
# order to prevent hammering the service.
Expand Down