This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Event creation rate limiting happens very late in a worker environment #16481
Labels
A-Workers
Problems related to running Synapse in Worker Mode (or replication)
O-Occasional
Affects or can be seen by some users regularly or most users rarely
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Defect
Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
When event persistence happens in a separate worker process to event creation, we don't end up applying the ratelimit until the event reaches the event persister.
This means we end up doing lots of work (including calculating the push actions and inserting into
event_push_actions_staging
) for an event that gets thrown away.There is code to attempt to apply the ratelimiter upfront (https://github.com/matrix-org/synapse/blob/v1.93.0/synapse/handlers/message.py#L1001-L1002), but it doesn't work in a worker environment because the count is never updated.
The text was updated successfully, but these errors were encountered: