Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix get_pdu asking every remote destination even after it finds an event #13346

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/13346.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix `get_pdu` asking every remote destination even after it finds an event.
MadLittleMods marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 3 additions & 3 deletions synapse/federation/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,9 @@ async def get_pdu(
# Prime the cache
self._get_pdu_cache[event.event_id] = event

# FIXME: We should add a `break` here to avoid calling every
# destination after we already found a PDU (will follow-up
# in a separate PR)
# Now that we have an event, we can break out of this
# loop and stop asking other destinations.
break
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be easy to add a regression to test to this, or no?

I'm not sure and I don't want to invest in looking into it. It's a bug that was never expressed because we never call get_pdu with more than one destination.


except SynapseError as e:
logger.info(
Expand Down