Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synapse does not attempt to send events in the device outbox at startup #16680

Closed
matrixbot opened this issue Dec 21, 2023 · 1 comment · Fixed by #16925
Closed

Synapse does not attempt to send events in the device outbox at startup #16680

matrixbot opened this issue Dec 21, 2023 · 1 comment · Fixed by #16925

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 21, 2023

This issue has been migrated from #16680.


Description

If you call /sendToDevice to a remote user, and that user's HS is temporarily down (not offline long enough to be blacklisted), it will not be sent. It will be stored in the device outbox federation table. If you then restart Synapse, it does not try to empty that table at startup. I waited 30s for it to do something.

This happens on sqlite, postgres and worker mode.

If the user sends another to-device event, the outbox is then cleared.

Steps to reproduce

Run this complement test and remove the "kick" event which happens after 10s in a goroutine: matrix-org/complement#694

Logs for HS1 (the one which gets restarted) running Postgres (no worker mode) attached.
postgres-hs1.log

Homeserver

Local

Synapse Version

v1.95

Installation Method

Docker (matrixdotorg/synapse)

Database

PostgreSQL

Workers

Single process

Platform

complement

Configuration

No response

Relevant log output

Attached.

Anything else that would be useful to know?

No response

@matrixbot matrixbot changed the title Dummy issue Synapse does not attempt to send events in the device outbox at startup Dec 22, 2023
@matrixbot matrixbot reopened this Dec 22, 2023
@richvdh richvdh self-assigned this Feb 14, 2024
@richvdh
Copy link
Member

richvdh commented Feb 15, 2024

If the user sends another to-device event, the outbox is then cleared.

... indeed, if any outgoing federation traffic happens (room events, typing notifications, device list updates) that will be enough to prompt us to process the outbox. Also, in general, an incoming federation transaction on a server previously marked as "down" will cause us to restart the federation transmission loop and process the outbox.

richvdh added a commit to matrix-org/complement that referenced this issue Mar 14, 2024
Now that element-hq/synapse#16680 has been fixed, we
can remove this redundant poke.
richvdh added a commit that referenced this issue Mar 22, 2024
…tup (#16925)

Fixes #16680, as well as a
related bug, where servers which we had *never* successfully sent an
event to would not be retried.

In order to fix the case of pending to-device messages, we hook into the
existing `wake_destinations_needing_catchup` process, by extending it to
look for destinations that have pending to-device messages. The
federation transmission loop then attempts to send the pending to-device
messages as normal.
richvdh added a commit to matrix-org/complement that referenced this issue Apr 10, 2024
Now that element-hq/synapse#16680 has been fixed, we
can remove this redundant poke.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants