element-hq / element-hq/synapse

Synchrotrons always wake up sync streams for presence updates

Open
#8,955 0 comments 0 reactions 0 assignees View on GitHub
A-Performance A-Presence A-Sync O-Occasional S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#8955](https://github.com/matrix-org/synapse/issues/8955).

---

When calculating presence changes we decide whether we should actively wake up sync streams, or if they should just be bundled up the next time we send a response for another reason. We do not appear to propagate whether to wake up sync streams across replication, and we appear to *always* notify for presence updates:

https://github.com/matrix-org/synapse/blob/6d02eb22dfde9551c515acaf73503e2500e00eaf/synapse/app/generic_worker.py#L381-L390

It's unclear how much this will help.

(Note that we batch up presence updates that we don't notify for and persist/replicate them once a minute).

Contributor guide

Open the contributing guide

Research direction

Start at synapse/app/generic_worker.py lines 381-390 and trace how the decision to wake sync streams is handled across replication. Compare notifying presence updates with updates that are batched and persisted or replicated once a minute. Done means the wake decision is propagated so non-notifying updates do not always actively wake sync streams.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.