Skip to content
Snippets Groups Projects
Unverified Commit 9cd18cc5 authored by Erik Johnston's avatar Erik Johnston Committed by GitHub
Browse files

Retry 5xx errors in federation client (#9567)

Fixes #8915
parent 7fdc6cef
No related branches found
No related tags found
No related merge requests found
Fix bug where federation requests were not correctly retried on 5xx responses.
......@@ -534,9 +534,10 @@ class MatrixFederationHttpClient:
response.code, response_phrase, body
)
# Retry if the error is a 429 (Too Many Requests),
# otherwise just raise a standard HttpResponseException
if response.code == 429:
# Retry if the error is a 5xx or a 429 (Too Many
# Requests), otherwise just raise a standard
# `HttpResponseException`
if 500 <= response.code < 600 or response.code == 429:
raise RequestSendFailed(exc, can_retry=True) from exc
else:
raise exc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment