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

Disable proactive sends for remote joins #12330

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all 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/12330.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid trying to calculate the state at outlier events.
6 changes: 6 additions & 0 deletions synapse/handlers/federation_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,12 @@ async def process_remote_join(
if context.rejected:
raise SynapseError(400, "Join event was rejected")

# the remote server is responsible for sending our join event to the rest
# of the federation. Indeed, attempting to do so will result in problems
# when we try to look up the state before the join (to get the server list)
# and discover that we do not have it.
event.internal_metadata.proactively_send = False

Comment on lines +472 to +477
Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, attempting to do so will result in problems

are these problems local to us only, or are there consequences for the rest of the federation? (i.e. does this scenario need to be called out in the spec?)

Copy link
Member Author

Choose a reason for hiding this comment

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

the main "problem" I'm trying to avoid is that I want to make getting the state at an outlier raise an exception (#12191), which is definitely a "local to us" problem.

The spec has this to say:

The resident server must also send the event to other servers participating in the room.

(my emphasis)

An example of a less local-to-us problem is that we might actually succeed in looking up the state, and then send another copy of the join event to the whole federation. Still, in the worst case that's just duplicate data, and isn't really any different from us deciding to, say, send out an event generated by another server.

In short - I think the spec says all it needs to?

return await self.persist_events_and_notify(room_id, [(event, context)])

async def backfill(
Expand Down