-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Complement Existing members see new members' presence
is flaky
#13199
Comments
Seen again at https://github.com/matrix-org/synapse/runs/7541314250?check_suite_focus=true#step:4:3959 (on a monolith sqlite deployment?) |
Existing members see new members' presence
is flaky
maybe this is happening more frequently now? Also seen at https://github.com/matrix-org/synapse/runs/7783161292?check_suite_focus=true (on a monolith) |
keyword: |
On SQLite in monolith mode, the test fails reliably if modified so that Bob's join appears in an initial sync. Bob's presence is offline(!) and it's only sent during incremental syncs, so this appears to be an issue with the test setup, or Synapse not setting Bob's presence to online upon a join. |
We appear to only bump presence when Bob sends a regular message. synapse/synapse/handlers/message.py Lines 1918 to 1921 in 86c5a71
That condition has been around since f70e622 from 2014. However, b31ec21 modified the bump to only transition from unavailable to online and changes nothing when a user is offline. So it seems that users intentionally do not go from offline to online when sending messages. synapse/synapse/handlers/presence.py Lines 964 to 965 in 86c5a71
|
Depending on timings, the "Existing members see new members' presence" test in `TestMembersLocal` may see the expected join and presence in an initial or incremental sync. Both types of sync elicit different behaviour in homeserver implementations, such as Synapse. Split the test into initial and incremental sync variants to eliminate the race condition. In addition, fix the initial sync case by explicitly setting Bob's presence to online. The spec does not guarantee that Bob will have a non-offline presence after merely joining a room, nor does the spec guarantee that offline presences will show up in initial syncs. Fixes matrix-org/synapse#13199.
It took me 363 runs (~3 hours of CI) to reproduce this, so maybe it's not the highest priority flake around.
The issue seems to be that Bob's presence information is not coming down sync.
I believe the reason we expect Bob's presence to come down sync is because
/join
involves sending an event and that should update his presence.I can't see the code that should trigger this in Synapse, but since this succeeds most of the time it must be there.
In the test logs for this test, I didn't spot any requests to
/_synapse/replication/presence_set_state/
for Bob, which I would have expected to see. (I do see some for Alice.)For this reason, I hesitate to brush it off as 'slow replication'. I also note that the requests in the log don't seem to be that slow around the time of the failure, so I don't suspect CPU contention.
The text was updated successfully, but these errors were encountered: