Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

[Presence] Flicker when using multiple devices simultaneously #15879

Closed

Description

@realtyem

I have not seen this in person, but I was informed this is a thing that happens.

From out-of-band

Well, in my case when I implemented a button to set your presence in Nheko, it killed my server, because I had an Element open somewhere and it was flip-flopping between 2 presence states at like 50ms per state

From #9415

Currently I sometimes have 2 clients fighting over presence changes and generating a lot of EDUs in rapid fashing, while some smoothing would be nice. Possibly synapse should just track presence per device and then send the "highest" presence, i.e. busy > online > unavailable > offline.

From #3971 (Although I feel some of this has been mitigated already, it seemed relevant)

An easy way to trigger it is to use the riot-ios app. Just opening the app and then sending it to the background would cause it to hit /_matrix/client/r0/presence/{userId}/status with PUT requests (either updating presence to online or to unavailable.. and after some more inactivity, to offline by a Synapse background task, it seems).
Doing that would cause 100% CPU for a while. I imagine Synapse tries to notify many other servers about the presence change. While this (non-important thing) is going on, Synapse would be slow to respond to other requests.
If I just keep alternating between backgrounding and foregrounding the riot-ios app, I can effectively keep my homeserver at 100% CPU.
Normally though, a few seconds after backgrounding the app (which sets my presence as unavailable), due to a subsequent foregrounding of the app or due to a /sync by another client of mine (on desktop or something), my presence status would change back to online and cause the same thing once again.

CC @nico-famedly

I'm not certain there is a way of reliably testing for this, and there is no guarantees on a video capturing it within the space of a frame(depending on factors such as speed of the system running the server).

It's very possible that fixing #9415 will fix this as well, or at least make it much better.

Activity

  1. H-Shay commented on Jul 5, 2023

    @H-Shay
    Contributor

    Unfortunately without logs and or anything concrete this is essentially non-actionable - if you can provide logs and screenshots of a specific example of this behavior happening we could investigate, but until then I am going to close this issue as we aren't able to take action on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions