From cd8691e3a236e44516f49c030cdace2271f5c6f8 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 5 Jun 2023 14:57:18 -0500 Subject: [PATCH 1/4] Add context for when/why to use the `long_retries` option when sending Federation requests See https://matrix.to/#/!vcyiEtMVHIhWXcJAfl:sw1v.org/$b56U7pYpjMqVMUU5ZU7yYLxohdTnjSOKOtrrZi8HVVs?via=matrix.org&via=element.io&via=pixie.town --- synapse/http/matrixfederationclient.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 9094dab0feb7..9b4e3fe6bc65 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -499,8 +499,11 @@ async def _send_request( 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) you can be a lot more lenient but its very fuzzy / hand-wavey. ignore_backoff: true to ignore the historical backoff data and try the request anyway. From 9c970e2b3fe3c8e69ebd15b09e1573e3aa1dde30 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 5 Jun 2023 14:59:17 -0500 Subject: [PATCH 2/4] Add changelog --- changelog.d/15721.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/15721.misc diff --git a/changelog.d/15721.misc b/changelog.d/15721.misc new file mode 100644 index 000000000000..f4d892daf970 --- /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. From 5630334429817b9c2f311b7cb604e4a3b0be0edc Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 5 Jun 2023 15:06:56 -0500 Subject: [PATCH 3/4] Perhaps future ideas --- synapse/http/matrixfederationclient.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 9b4e3fe6bc65..c8859485b28a 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -503,7 +503,11 @@ async def _send_request( 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) you can be a lot more lenient but its very fuzzy / hand-wavey. + 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 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. From 9dd056c19f9c3f4e93567373ecc90ce08f0f57d8 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 5 Jun 2023 15:07:55 -0500 Subject: [PATCH 4/4] Grammar --- synapse/http/matrixfederationclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index c8859485b28a..abb5ae581521 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -506,7 +506,7 @@ async def _send_request( 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 looking at things with the bigger picture in mind, + 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