element-hq / element-hq/dendrite
Dendrite sends presence multiple times per second
- Dominant language
- Go
- Stars
- 965
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
*This issue was originally created by [**@Fale**](https://github.com/Fale) at .*
### Background information
- **Dendrite version or git SHA**: 0.13.2
- **SQLite3 or Postgres?**: Postgre
- **Running in Docker?**: in Podman
- **`go version`**: n/a
- **Client used (if applicable)**: n/a
### Description
- **What** is the problem: The server floods other servers sending live activities multiple times per second
- **Who** is affected: The server resources as well as all the other servers federated
- **How** is this bug manifesting: In the logs. Both own logs (first snippet) and other servers logs (second snippet), eg:
```
time="2023-10-15T13:24:07.151689353Z" level=info msg="Sending EDU event" destinations=429 edu_type=m.presence
time="2023-10-15T13:24:07.614874549Z" level=info msg="Sending EDU event" destinations=429 edu_type=m.presence
time="2023-10-15T13:24:08.076643337Z" level=info msg="Sending EDU event" destinations=429 edu_type=m.presence
time="2023-10-15T13:24:08.671475521Z" level=info msg="Sending EDU event" destinations=429 edu_type=m.presence
```
```
Oct 15 16:24:08 omega systemd-chat-synapse[4122]: 2023-10-15 14:24:08,959 - synapse.access.http.8008 - 465 - INFO - PUT-129397 - 10.89.4.4 - 8008 - {fale.io} Processed request: 0.020sec/0.002sec (0.005sec, 0.001sec) (0.003sec/0.009sec/5) 11B 200 "PUT /_matrix/federation/v1/send/1697379832052-35685 HTTP/1.1" "Dendrite/0.13.2+57ddbe0.57ddbe0" [0 dbevts]
Oct 15 16:24:08 omega systemd-chat-synapse[4122]: 2023-10-15 14:24:08,511 - synapse.access.http.8008 - 465 - INFO - PUT-129396 - 10.89.4.4 - 8008 - {fale.io} Processed request: 0.008sec/0.001sec (0.004sec, 0.000sec) (0.001sec/0.003sec/2) 11B 200 "PUT /_matrix/federation/v1/send/1697379831617-35684 HTTP/1.1" "Dendrite/0.13.2+57ddbe0.57ddbe0" [0 dbevts]
Oct 15 16:24:08 omega systemd-chat-synapse[4122]: 2023-10-15 14:24:08,086 - synapse.access.http.8008 - 465 - INFO - PUT-129395 - 10.89.4.4 - 8008 - {fale.io} Processed request: 0.010sec/0.001sec (0.003sec, 0.001sec) (0.001sec/0.003sec/2) 11B 200 "PUT /_matrix/federation/v1/send/1697379831190-35683 HTTP/1.1" "Dendrite/0.13.2+57ddbe0.57ddbe0" [0 dbevts]
Oct 15 16:24:07 omega systemd-chat-synapse[4122]: 2023-10-15 14:24:07,595 - synapse.access.http.8008 - 465 - INFO - PUT-129394 - 10.89.4.4 - 8008 - {fale.io} Processed request: 0.006sec/0.000sec (0.001sec, 0.000sec) (0.001sec/0.002sec/2) 11B 200 "PUT /_matrix/federation/v1/send/1697379830703-35682 HTTP/1.1" "Dendrite/0.13.2+57ddbe0.57ddbe0" [0 dbevts]
```
- **When** did this first appear: After installing the sliding-sync proxy v0.99.10
### Steps to reproduce
- install Dendrite server
- install Sliding proxy
### Workaround
To avoid to flood everyone while this issue is being looked at, I've changed the dendrite config as:
```
presence:
enable_inbound: true
enable_outbound: false
```
so now those messages are not sent anymore
Contributor guide
Research direction
Start by reproducing the repeated m.presence EDU sends with Dendrite 0.13.2 and the Sliding Sync proxy v0.99.10, then inspect the presence and federation paths involved. Compare behavior with outbound presence enabled and disabled; done means presence is not emitted multiple times per second while federation still behaves correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100