summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2023-06-06 16:25:03 -0500
committerGitHub <noreply@github.com>2023-06-06 16:25:03 -0500
commit33c3550887f412f015cf651db82a9082bb12cd9e (patch)
tree75ddeb9c76462f04c8fc5277fc152c05170f4d9f
parentImprove performance of user directory search (#15729) (diff)
downloadsynapse-33c3550887f412f015cf651db82a9082bb12cd9e.tar.xz
Add context for when/why to use the `long_retries` option when sending Federation requests (#15721)
-rw-r--r--changelog.d/15721.misc1
-rw-r--r--synapse/http/matrixfederationclient.py11
2 files changed, 10 insertions, 2 deletions
diff --git a/changelog.d/15721.misc b/changelog.d/15721.misc
new file mode 100644
index 0000000000..f4d892daf9
--- /dev/null
+++ b/changelog.d/15721.misc
@@ -0,0 +1 @@
+Add context for when/why to use the `long_retries` option when sending Federation requests.
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py
index 9094dab0fe..abb5ae5815 100644
--- a/synapse/http/matrixfederationclient.py
+++ b/synapse/http/matrixfederationclient.py
@@ -499,8 +499,15 @@ class MatrixFederationHttpClient:
                 Note that the above intervals are *in addition* to the time spent
                 waiting for the request to complete (up to `timeout` ms).
 
-                NB: the long retry algorithm takes over 20 minutes to complete, with
-                a default timeout of 60s!
+                NB: the long retry algorithm takes over 20 minutes to complete, with a
+                default timeout of 60s! It's best not to use the `long_retries` option
+                for something that is blocking a client so we don't make them wait for
+                aaaaages, whereas some things like sending transactions (server to
+                server) we can be a lot more lenient but its very fuzzy / hand-wavey.
+
+                In the future, we could be more intelligent about doing this sort of
+                thing by looking at things with the bigger picture in mind,
+                https://github.com/matrix-org/synapse/issues/8917
 
             ignore_backoff: true to ignore the historical backoff data
                 and try the request anyway.