Skip to content

Commit 9a743a4

Browse files
authored
Don't retry joining partial state rooms all at once (#19402)
On restart we retry joining partially stated rooms, but if you have a bunch in the database this can cause big performance issues if we start them all at once. So we stagger them.
1 parent 064237a commit 9a743a4

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

changelog.d/19402.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Don't retry joining partial state rooms all at once on startup.

synapse/handlers/federation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,6 +1788,10 @@ async def _resume_partial_state_room_sync(self) -> None:
17881788
room_id=room_id,
17891789
)
17901790

1791+
# We don't start all the partial state room syncs at once, to avoid
1792+
# overloading the process.
1793+
await self.clock.sleep(Duration(milliseconds=10))
1794+
17911795
def _start_partial_state_room_sync(
17921796
self,
17931797
initial_destination: str | None,

0 commit comments

Comments
 (0)