Retry with fresh socket on 499

Change-Id: I0c22eefb587375997672724c03744c9cda473708
This commit is contained in:
Tim Burke 2023-02-15 21:00:51 -08:00
parent 7bd0951086
commit ff6b359d06
2 changed files with 4 additions and 1 deletions

View File

@ -1821,7 +1821,9 @@ class Connection:
retried_auth = True
elif self.attempts > self.retries or err.http_status is None:
raise
elif err.http_status == 408:
elif err.http_status in (408, 499):
# Server hit a timeout, so HTTP request/response framing
# are likely in a bad state; trash the connection
self.http_conn = None
elif 500 <= err.http_status <= 599:
pass

View File

@ -2224,6 +2224,7 @@ class TestConnection(MockHttpTest):
do_test(401, 2)
# others will be tried until retry limits
do_test(408, 6)
do_test(499, 6)
do_test(500, 6)
do_test(503, 6)