summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--swiftclient/client.py4
-rw-r--r--test/unit/test_swiftclient.py1
2 files changed, 4 insertions, 1 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py
index e42ac70..b9f12aa 100644
--- a/swiftclient/client.py
+++ b/swiftclient/client.py
@@ -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
diff --git a/test/unit/test_swiftclient.py b/test/unit/test_swiftclient.py
index ae3e76f..55b4679 100644
--- a/test/unit/test_swiftclient.py
+++ b/test/unit/test_swiftclient.py
@@ -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)