-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Element R: App freezes while backing up megolm keys #26488
Element R: App freezes while backing up megolm keys #26488
Comments
Part of the problem here is #26347, though that doesn't explain why it locks up the UI while it's happening. |
@anoadragon453 has sent me a performance profile demonstrating the problem. It shows calls to |
This is clearly an insane way to do things, since the key store can grow very large indeed. We need to update the indexeddb object store so that it keeps a queryable record of which sessions need backing up. The hardest part of this is likely to be migrating existing data; given EWR is relatively experimental, perhaps we can get away with just assuming that all existing keys are backed up. |
just as a datapoint: disabling seshat has stopped my logs tight-looping with keyshare reqs. but the freezing (presumably due to this bug) is as bad as it was before (and makes the app pretty much unusable). |
A set of non-functional changes which lay some groundwork in preparation for fixing element-hq/element-web#26488.
Currently, querying for inbound group sessions which need backing up is very inefficient: we have to search through the whole list. Here, we change the way they are stored so that we can maintain an index of the ones that need a backup. Fixes: element-hq/element-web#26488 Fixes: #2877 --- * indexeddb: Update storage for inbound_group_sessions Currently, querying for inbound group sessions which need backing up is very inefficient: we have to search through the whole list. Here, we change the way they are stored so that we can maintain an index of the ones that need a backup. * Rename functions for clarity * Remove spurious log line This was a bit verbose * Rename constants for i_g_s store names * improve log messages * add a warning * Rename `InboundGroupSessionIndexedDbObject.data` * formatting
This is still happening in today's nightly (which i believe has the fix):
I can't save a perf trace on it due to electron/electron#39818 but a screenshot of a profile looks like: |
@ara4n unfortunately that profile doesn't tell us a great deal. @BillCarsonFr also reported continued freezing after the fix landed, but I don't think we have a profile from him either :(. (He did report that it went away having merged matrix-org/matrix-js-sdk#3934 into his dev copy, but that feels like fixing the symptoms rather than the cause.) |
I too am continuing to experience freezes on:
Initially, the application runs fine, even after feeding it my key backup passphrase. Then, I go into Security & Privacy settings and try to see the status of key backup. I imagine this trigger key backup to start, at which point the application shows familiar signs of freezing for 5-10s every 5 seconds. Element employees can view a performance trace from Chromium here: https://matrix.to/#/!UcgyhoigetVICUfvRw:matrix.org/$ykAFN0Z3NRkiyTGVWBLelZpiS72mQ_gXoL19IISZtWA?via=element.io&via=matrix.org&via=jki.re |
will add debug symbols to profile #26693 |
I got a trace from EWR (not EDR) here, fwiw: https://github.com/matrix-org/element-web-rageshakes/issues/23324 |
Ok, it turns out that there is another call to I think we need a new method in CryptoStore which takes the list of room/sender/session triplets from the backup request, and marks them all as sent. |
I think this is also responsible for logs along the lines of:
(and also things like -- in short, it's taking tens of seconds to read all the inbound group sessions from the store, and indexeddb is complaining about it. |
The app is still freezing for minutes on end when backing up megolm keys. |
actually, it's not freezing, it's "just" taking 1-5 mins to send msgs |
ie, it's #26783 |
Steps to reproduce
@andrewm:element.io
account.Outcome
What did you expect?
No freezing.
What happened instead?
The app freezes for ~10s at a time, every 2-5s. It appears the UI thread if getting blocked behind something in the Rust crypto layer. Taking a performance recording in Chrome, I see that
wasm-function[xxxx]
is the culprit, but no more data than that.The app freezes, then once it unfreezes, the following log is printed:
this continues over and over, each time with a different set of 100 keys.
Operating system
NixOS Linux
Browser information
Chromium v118.0.5993.117
URL for webapp
develop.element.io
Application version
Both on develop.element.io and when building from latest source today, I also built and linked matrix-rust-sdk-crypto-wasm
Homeserver
element.io
Will you send logs?
No
The text was updated successfully, but these errors were encountered: