mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-12 05:37:48 +00:00
Correctly handle 500's and 429 on federation
This commit is contained in:
1 parent
7e03f9a484
commit
aaecffba3a
2 files changed
+8
-1
No files matched your search
@@ -462,6 +462,13 @@ class TransactionQueue(object):
|
||||
code = e.code
|
||||
response = e.response
|
||||
|
||||
if e.code == 429 or 500 <= e.code:
|
||||
logger.info(
|
||||
"TX [%s] {%s} got %d response",
|
||||
destination, txn_id, code
|
||||
)
|
||||
raise e
|
||||
|
||||
logger.info(
|
||||
"TX [%s] {%s} got %d response",
|
||||
destination, txn_id, code
|
||||
|
||||
@@ -123,7 +123,7 @@ class RetryDestinationLimiter(object):
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
valid_err_code = False
|
||||
if exc_type is not None and issubclass(exc_type, CodeMessageException):
|
||||
valid_err_code = 0 <= exc_val.code < 500
|
||||
valid_err_code = valid_err_code != 429 and 0 <= exc_val.code < 500
|
||||
|
||||
if exc_type is None or valid_err_code:
|
||||
# We connected successfully.
|
||||
|
||||
Reference in new issue
Block a user