Skip to content

Commit

Permalink
Add status code 502 to the urllib retry list
Browse files Browse the repository at this point in the history
fixes pypa#11843
related pypa#12008
  • Loading branch information
bdraco committed Jan 30, 2024
1 parent 89950c5 commit 9cf1c5e
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
# 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 9cf1c5e

Please sign in to comment.