matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.79k stars 2.13k forks source link

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

Open kegsay opened 9 months ago

kegsay commented 9 months ago

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: https://github.com/matrix-org/complement/pull/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

kegsay commented 9 months ago

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

The user only needs to send a to-device event to someone on the remote homeserver, it doesn't need to be specific.