summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-07-27 04:40:04 -0500
committerGitHub <noreply@github.com>2022-07-27 10:40:04 +0100
commit4f3082d6bf85335d10775a2e869420592189c6b2 (patch)
tree58f2a34da48085bf835226026531a45595c9491a
parentCopy room serials before handling in `get_new_events_as` (#13392) (diff)
downloadsynapse-4f3082d6bf85335d10775a2e869420592189c6b2.tar.xz
Fix `get_pdu` asking every remote destination even after it finds an event (#13346)
-rw-r--r--changelog.d/13346.misc1
-rw-r--r--synapse/federation/federation_client.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/changelog.d/13346.misc b/changelog.d/13346.misc
new file mode 100644
index 0000000000..06557c8481
--- /dev/null
+++ b/changelog.d/13346.misc
@@ -0,0 +1 @@
+Fix long-standing bugged logic which was never hit in `get_pdu` asking every remote destination even after it finds an event.
diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py
index 842f5327c2..02276ed995 100644
--- a/synapse/federation/federation_client.py
+++ b/synapse/federation/federation_client.py
@@ -403,9 +403,9 @@ class FederationClient(FederationBase):
                         # 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
 
                 except SynapseError as e:
                     logger.info(