Skip to content

Commit 94ffff1

Browse files
squahtxazmeuk
authored andcommitted
Fix error when out of servers to sync partial state with (matrix-org#13432)
so that we raise the intended error instead. Signed-off-by: Sean Quah <[email protected]>
1 parent 62dfc78 commit 94ffff1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

changelog.d/13432.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Faster room joins: Fix error when running out of servers to sync partial state with, so that Synapse raises the intended error instead.

synapse/handlers/federation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,15 +1543,16 @@ async def _sync_partial_state_room(
15431543

15441544
# Make an infinite iterator of destinations to try. Once we find a working
15451545
# destination, we'll stick with it until it flakes.
1546+
destinations: Collection[str]
15461547
if initial_destination is not None:
15471548
# Move `initial_destination` to the front of the list.
15481549
destinations = list(other_destinations)
15491550
if initial_destination in destinations:
15501551
destinations.remove(initial_destination)
15511552
destinations = [initial_destination] + destinations
1552-
destination_iter = itertools.cycle(destinations)
15531553
else:
1554-
destination_iter = itertools.cycle(other_destinations)
1554+
destinations = other_destinations
1555+
destination_iter = itertools.cycle(destinations)
15551556

15561557
# `destination` is the current remote homeserver we're pulling from.
15571558
destination = next(destination_iter)

0 commit comments

Comments
 (0)