matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.83k stars 2.13k forks source link

Claim local one-time-keys in bulk #16565

Closed DMRobertson closed 1 year ago

DMRobertson commented 1 year ago

One of the performance optimsations that Rich spotted in https://github.com/matrix-org/synapse/issues/16554. Another in #16570.

See https://gist.github.com/DMRobertson/243121754aed82eff56fa8ec5181184a for how I convinced myself that the SQL query was legit.

Commitwise reviewable, but sitting in CI over the weekend to see if this works.

DMRobertson commented 1 year ago

I think the sytest failure is a flake. Waiting for sytest+workers to finish but I'm gonna assume they pass.

clokep commented 1 year ago

I kicked them off again, not sure if they flaked twice or not though.

clokep commented 1 year ago

And I think the same question as #16570 -- any idea if this is unit tested? I think it has decent tests though.

DMRobertson commented 1 year ago

And I think the same question as #16570 -- any idea if this is unit tested? I think it has decent tests though.

Similar deal. There are tests for handling one key at a time, but none for bulk. I can cobble one together.

DMRobertson commented 1 year ago

And I think the same question as #16570 -- any idea if this is unit tested? I think it has decent tests though.

Similar deal. There are tests for handling one key at a time, but none for bulk. I can cobble one together.

:ping_pong: back you, Patrick. I'm not super thrilled with how the test came out and it feels a little too abstract. WDYT?

clokep commented 1 year ago

(Assuming the thread I left is accurate)