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

Split FederationHandler in half #10692

Merged
merged 27 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f2dfff5
Create framework for FederationEventHandler
richvdh Aug 24, 2021
763bb0a
Move `_update_context_for_auth_events` to `FederationEventHandler`
richvdh Aug 24, 2021
77dbf25
Move `_update_auth_events_and_context_for_auth` to `FederationEventHa…
richvdh Aug 24, 2021
cf39eb0
Move `_check_event_for_soft_fail` to `FederationEventHandler`
richvdh Aug 24, 2021
40c3074
Move `_check_event_auth` to `FederationEventHandler`
richvdh Aug 25, 2021
4aa5903
Move `_notify_persisted_event` to `FederationEventHandler`
richvdh Aug 24, 2021
2ae1b38
Move `persist_events_and_notify` to `FederationEventHandler`
richvdh Aug 24, 2021
b4fc349
Move `_run_push_actions_and_persist_event` to `FederationEventHandler`
richvdh Aug 24, 2021
e97281f
Move `_auth_and_persist_event` to `FederationEventHandler`
richvdh Aug 24, 2021
84e3546
Move `_auth_and_persist_events` to `FederationEventHandler`
richvdh Aug 24, 2021
79e254f
Move `_NewEventInfo` to `federation_event`
richvdh Aug 25, 2021
c09c1d7
Move `_get_events_and_persist` to `FederationEventHandler`
richvdh Aug 25, 2021
1ef3798
Move `_handle_marker_event` to `FederationEventHandler`
richvdh Aug 25, 2021
e2219c0
Move `_resync_device` to `FederationEventHandler`
richvdh Aug 25, 2021
7b3c960
Move `_process_received_pdu` to `FederationEventHandler`
richvdh Aug 25, 2021
6074925
Move `_get_state_after_missing_prev_event` to `FederationEventHandler`
richvdh Aug 25, 2021
0241a2a
Move `_resolve_state_at_missing_prevs` to `FederationEventHandler`
richvdh Aug 25, 2021
3151fa9
Move `_sanity_check_event` to `FederationEventHandler`
richvdh Aug 25, 2021
f120846
Move `_process_pulled_event` to `FederationEventHandler`
richvdh Aug 25, 2021
945c634
Move `_process_pulled_events` to `FederationEventHandler`
richvdh Aug 25, 2021
417cb35
Move `_get_missing_events_for_pdu` to `FederationEventHandler`
richvdh Aug 25, 2021
bc4acb2
Move `backfill` to `FederationEventHandler`
richvdh Aug 25, 2021
a6cce83
Move `_check_join_restrictions` to `FederationEventHandler`
richvdh Aug 25, 2021
5b22939
Move `on_send_membership_event` to `FederationEventHandler`
richvdh Aug 25, 2021
4b0d85c
Move `room_queue` to `FederationEventHandler`
richvdh Aug 25, 2021
89dd601
Move `on_receive_pdu` to `FederationEventHander`
richvdh Aug 25, 2021
b9918a6
changelog
richvdh Aug 25, 2021
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/10692.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Split the event-processing methods in `FederationHandler` into a separate `FederationEventHandler`.
7 changes: 5 additions & 2 deletions synapse/federation/federation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def __init__(self, hs: "HomeServer"):
super().__init__(hs)

self.handler = hs.get_federation_handler()
self._federation_event_handler = hs.get_federation_event_handler()
self.state = hs.get_state_handler()
self._event_auth_handler = hs.get_event_auth_handler()

Expand Down Expand Up @@ -787,7 +788,9 @@ async def _on_send_membership_event(

event = await self._check_sigs_and_hash(room_version, event)

return await self.handler.on_send_membership_event(origin, event)
return await self._federation_event_handler.on_send_membership_event(
origin, event
)

async def on_event_auth(
self, origin: str, room_id: str, event_id: str
Expand Down Expand Up @@ -1005,7 +1008,7 @@ async def _process_incoming_pdus_in_room_inner(
async with lock:
logger.info("handling received PDU: %s", event)
try:
await self.handler.on_receive_pdu(origin, event)
await self._federation_event_handler.on_receive_pdu(origin, event)
except FederationError as e:
# XXX: Ideally we'd inform the remote we failed to process
# the event, but we can't return an error in the transaction
Expand Down
Loading