Skip to content

Commit 4779b9d

Browse files
jack-edmonds-ddci.datadog-api-spec
andauthored
Add 408s to retries to Python API Client (#2945)
* Retry on 408 See https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.7 which says that clients may retry 408 requests. --------- Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent af847ed commit 4779b9d

File tree

2 files changed

+2
-2
lines changed
  • .generator/src/generator/templates
  • src/datadog_api_client

2 files changed

+2
-2
lines changed

.generator/src/generator/templates/rest.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ from {{ package }}.exceptions import (
2121
logger = logging.getLogger(__name__)
2222

2323

24-
RETRY_AFTER_STATUS_CODES = frozenset([429, 500, 501, 502, 503, 504, 505, 506, 507, 509, 510, 511, 512])
24+
RETRY_AFTER_STATUS_CODES = frozenset([408, 429, 500, 501, 502, 503, 504, 505, 506, 507, 509, 510, 511, 512])
2525
RETRY_ALLOWED_METHODS = frozenset(["GET", "PUT", "DELETE", "POST", "PATCH"])
2626

2727

src/datadog_api_client/rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
logger = logging.getLogger(__name__)
2424

2525

26-
RETRY_AFTER_STATUS_CODES = frozenset([429, 500, 501, 502, 503, 504, 505, 506, 507, 509, 510, 511, 512])
26+
RETRY_AFTER_STATUS_CODES = frozenset([408, 429, 500, 501, 502, 503, 504, 505, 506, 507, 509, 510, 511, 512])
2727
RETRY_ALLOWED_METHODS = frozenset(["GET", "PUT", "DELETE", "POST", "PATCH"])
2828

2929

0 commit comments

Comments
 (0)