summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-01-31 13:46:38 +0000
committerErik Johnston <erik@matrix.org>2017-01-31 13:46:38 +0000
commit85c590105f87a6cd138f1509f70087aa0881cf2d (patch)
tree1f74b4e8b50f89c857154cc6730d02a9b1dedfa3 /synapse
parentBetter handle 404 response for federation /send/ (diff)
downloadsynapse-85c590105f87a6cd138f1509f70087aa0881cf2d.tar.xz
Comment
Diffstat (limited to 'synapse')
-rw-r--r--synapse/util/retryutils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/util/retryutils.py b/synapse/util/retryutils.py
index cc88a0b532..0961dd5b25 100644
--- a/synapse/util/retryutils.py
+++ b/synapse/util/retryutils.py
@@ -125,6 +125,10 @@ 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):
+            # Some error codes are perfectly fine for some APIs, whereas other
+            # APIs may expect to never received e.g. a 404. It's important to
+            # handle 404 as some remote servers will return a 404 when the HS
+            # has been decommissioned.
             if exc_val.code < 400:
                 valid_err_code = True
             elif exc_val.code == 404 and self.backoff_on_404: