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

Remove duplicate call to wake a remote destination when using federation sending worker #16515

Merged
merged 3 commits into from
Oct 24, 2023

Conversation

realtyem
Copy link
Contributor

...and remove some additional code that appears to be 'dead' now.
Please read actual commit messages for details.

Pull Request Checklist

Signed-off-by: Jason Little [email protected]

This one(that is being removed) in particular calls into the replication data handler
that passes the call into a federation sender handler before landing in the federation
sender itself. The one being kept calls directly into the federation sender.
@realtyem realtyem marked this pull request as ready for review October 18, 2023 01:11
@realtyem realtyem requested a review from a team as a code owner October 18, 2023 01:11
Copy link
Member

Choose a reason for hiding this comment

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

I think your analysis is correct; I did a quick flowchart of all the calls from these:

flowchart
    ReplicationCommandHandler.on_REMOTE_SERVER_UP --> ReplicationDataHandler.on_remote_server_up
    ReplicationDataHandler.on_remote_server_up -->|If shouldSendFederation| FederationSenderHandler.wake_destination
    FederationSenderHandler.wake_destination --> FederationSender.wake_destination

    ReplicationCommandHandler.on_REMOTE_SERVER_UP --> Notifier.notify_remote_server_up
    Notifier.notify_remote_server_up -->|If shouldSendFederation| AbstractFederationSender.wake_destination
    AbstractFederationSender.wake_destination -.->|shouldSendFederation guarantees this path| FederationSender.wake_destination
    FederationSender.wake_destination --> PerDestinationQueue.attempt_new_transaction

    AbstractFederationSender.wake_destination -.->FederationRemoteSendQueue.wake_destination

    Notifier.notify_remote_server_up --> MatrixFederationHttpClient.wake_destination
    MatrixFederationHttpClient.wake_destination --> AwakenableSleeper.wake
Loading

The tl;dr is that it looks like we can remove the ReplicationDataHandler path, as you did.

It looks like previously the notifier was only called on the main process, but #7352 changed this once the remote server up command was not relayed via the main process.

@clokep clokep requested a review from a team October 18, 2023 13:57
Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

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

Double checked this with @erikjohnston and we don't see any ways this could break.

@clokep clokep merged commit ffbe9b7 into matrix-org:develop Oct 24, 2023
38 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants