From 16a447303455030150c13925844ec084c8d9b00d Mon Sep 17 00:00:00 2001 From: David Robertson Date: Wed, 25 Jan 2023 15:14:26 +0000 Subject: [PATCH 1/3] Bump the client-side timeout for /state to allow faster joins resyncs the chance to complete for large rooms. We have seen this fair poorly (~90s for Matrix HQ's /state) in testing, causing the resync to advance to another HS who hasn't seen our join yet. --- synapse/federation/transport/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/synapse/federation/transport/client.py b/synapse/federation/transport/client.py index 556883f0798b..730169f72298 100644 --- a/synapse/federation/transport/client.py +++ b/synapse/federation/transport/client.py @@ -102,6 +102,10 @@ async def get_room_state( destination, path=path, args={"event_id": event_id}, + # This can take a looooooong time for large rooms. Give this a generous + # timeout, to avoid the partial state resync timing out early and trying + # a bunch of servers who haven't see our join yet. + timeout=600, parser=_StateParser(room_version), ) From 840ba65d927e674152e9e7a46bb525de90cf5bf7 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Wed, 25 Jan 2023 15:18:17 +0000 Subject: [PATCH 2/3] Changelog --- changelog.d/14912.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/14912.misc diff --git a/changelog.d/14912.misc b/changelog.d/14912.misc new file mode 100644 index 000000000000..9dbc6b3424af --- /dev/null +++ b/changelog.d/14912.misc @@ -0,0 +1 @@ +Faster joins: allow the resync process more time to fetch `/state` ids. From 5d8486d43ebddf42245204501bd32855c93be7c4 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Wed, 25 Jan 2023 15:27:18 +0000 Subject: [PATCH 3/3] Milliseconds!!!! --- synapse/federation/transport/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/synapse/federation/transport/client.py b/synapse/federation/transport/client.py index 730169f72298..682666ab3602 100644 --- a/synapse/federation/transport/client.py +++ b/synapse/federation/transport/client.py @@ -103,9 +103,9 @@ async def get_room_state( path=path, args={"event_id": event_id}, # This can take a looooooong time for large rooms. Give this a generous - # timeout, to avoid the partial state resync timing out early and trying - # a bunch of servers who haven't see our join yet. - timeout=600, + # timeout of 10 minutes to avoid the partial state resync timing out early + # and trying a bunch of servers who haven't seen our join yet. + timeout=600_000, parser=_StateParser(room_version), )