Skip to content

Commit

Permalink
Merge pull request #12500 from bdraco/add_502
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr authored Feb 2, 2024
2 parents 99a82b7 + aa930c4 commit c0801ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/11843.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Retry on HTTP status code 502
3 changes: 2 additions & 1 deletion src/pip/_internal/network/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,9 @@ def __init__(
# is typically considered a transient error so we'll go ahead and
# retry it.
# A 500 may indicate transient error in Amazon S3
# A 502 may be a transient error from a CDN like CloudFlare or CloudFront
# A 520 or 527 - may indicate transient error in CloudFlare
status_forcelist=[500, 503, 520, 527],
status_forcelist=[500, 502, 503, 520, 527],
# Add a small amount of back off between failed requests in
# order to prevent hammering the service.
backoff_factor=0.25,
Expand Down

0 comments on commit c0801ef

Please sign in to comment.