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

To-device messages delayed by _DestinationWakeupQueue #15161

Closed
richvdh opened this issue Feb 27, 2023 · 5 comments · Fixed by #15297
Closed

To-device messages delayed by _DestinationWakeupQueue #15161

richvdh opened this issue Feb 27, 2023 · 5 comments · Fixed by #15297
Labels
A-E2EE End-to-end encryption for Matrix clients O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@richvdh
Copy link
Member

richvdh commented Feb 27, 2023

Description

#12132 introduced functionality to spread out the federation transmission requests due to device-list updates. However it also applies to to-device messages (due to the default immediate=False at https://github.com/matrix-org/synapse/pull/12132/files#diff-4db75239ae91da3be91b6ccacb4dc969be778e832da2976b9b8fd628f16e6b52R674) which doesn't appear to have been the intention, and can cause significant delays in transmission of to-device messages.

Steps to reproduce

  • log in on a new device
  • soon after, send an E2E message
  • express sadness at how long the keys take to turn up.

Homeserver

sw1v.org

Synapse Version

{"server_version":"1.77.0 (b=HEAD,t=v1.77.0,3e90dfdd8)","python_version":"3.7.3"}

Installation Method

Docker (matrixdotorg/synapse)

Database

postgres

Workers

Single process

Platform

debian somethingsomething

Configuration

experimental_features:
  msc3958_supress_edit_notifs: True

Relevant log output

Adjacent federation transmissions to element.io:

2023-02-23 13:31:47,814 - synapse.federation.sender.transaction_manager - 127 - INFO - federation_transaction_transmission_loop-97225 - TX [element.io] {1676822929244} Sending transaction [1676822929244], (PDUs: 1, EDUs: 2)
2023-02-23 13:31:48,277 - synapse.http.matrixfederationclient - 308 - INFO - federation_transaction_transmission_loop-97225 - {PUT-O-2230172} [element.io] Completed request: 200 OK in 0.46 secs, got 60 bytes - PUT matrix://element.io/_matrix/federation/v1/send/1676822929244
2023-02-23 13:31:48,277 - synapse.federation.sender.transaction_manager - 174 - INFO - federation_transaction_transmission_loop-97225 - TX [element.io] {1676822929244} got 200 response
2023-02-23 13:36:22,721 - synapse.federation.sender.transaction_manager - 127 - INFO - federation_transaction_transmission_loop-101748 - TX [element.io] {1676822931004} Sending transaction [1676822931004], (PDUs: 0, EDUs: 94)
2023-02-23 13:36:26,499 - synapse.http.matrixfederationclient - 308 - INFO - federation_transaction_transmission_loop-101748 - {PUT-O-2233711} [element.io] Completed request: 200 OK in 3.78 secs, got 11 bytes - PUT matrix://element.io/_matrix/federation/v1/send/1676822931004
2023-02-23 13:36:26,499 - synapse.federation.sender.transaction_manager - 174 - INFO - federation_transaction_transmission_loop-101748 - TX [element.io] {1676822931004} got 200 response

Anything else that would be useful to know?

No response

@richvdh
Copy link
Member Author

richvdh commented Feb 27, 2023

@H-Shay
Copy link
Contributor

H-Shay commented Feb 27, 2023

Could this be resolved by adding immediate=True to this call here?

@richvdh
Copy link
Member Author

richvdh commented Feb 28, 2023

Could this be resolved by adding immediate=True to this call here?

I think that would fix this particular case, yes. But it looks to me as though the intention was that the default be immediate=True. @erikjohnston any opinions?

@H-Shay H-Shay added A-E2EE End-to-end encryption for Matrix clients T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Blocks non-critical functionality, workarounds exist. labels Mar 6, 2023
@erikjohnston
Copy link
Member

Ah, yup. I very much thing I meant the default should be immediate=True

@H-Shay
Copy link
Contributor

H-Shay commented Mar 20, 2023

Right I can fix that then, will put up a PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-E2EE End-to-end encryption for Matrix clients O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants