Skip to content
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

NSE can be blocked until the app resumes #4335

Closed
manuroe opened this issue May 17, 2021 · 1 comment
Closed

NSE can be blocked until the app resumes #4335

manuroe opened this issue May 17, 2021 · 1 comment

Comments

@manuroe
Copy link
Member

manuroe commented May 17, 2021

The extension can be blocked waiting for the opening of the realm db, which seems to be locked by the app that did not release the Realm "lock" before going to background.
The process of all incoming pushes will be blocked until the app resumes.

We already had an interprocess lock issue between the app and NSE (#3906) but it was for write operation.

In NSE logs below, the extension was blocked for 1.6s until the app resumes. Once unblocked, we can see the extension completing all pending opening of MXRealmCryptoStore:

2021-05-14 16:31:31.911 RiotNSE[32018:18682482] [MXHTTPClient] cleanupBackgroundTask
2021-05-14 16:31:31.911 RiotNSE[32018:18682482] [MXKAccountManager] saveAccounts...
2021-05-14 16:31:31.915 RiotNSE[32018:18682482] [MXKAccountManager] saveAccounts. Done (result: 1) in 4ms
XXXX
2021-05-14 16:31:33.557 RiotNSE[32018:18682506] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.560 RiotNSE[32018:18682506] [MXRealmCryptoStore] Schema version: 16
2021-05-14 16:31:33.570 RiotNSE[32018:18683205] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.570 RiotNSE[32018:18682530] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.576 RiotNSE[32018:18684507] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.579 RiotNSE[32018:18684482] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.582 RiotNSE[32018:18684482] [MXRealmCryptoStore] Schema version: 16
2021-05-14 16:31:33.584 RiotNSE[32018:18685913] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.586 RiotNSE[32018:18686627] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.586 RiotNSE[32018:18687272] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.587 RiotNSE[32018:18688057] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.592 RiotNSE[32018:18689195] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.593 RiotNSE[32018:18689823] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.594 RiotNSE[32018:18689989] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.596 RiotNSE[32018:18690651] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.596 RiotNSE[32018:18690650] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.602 RiotNSE[32018:18691001] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.604 RiotNSE[32018:18691540] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.606 RiotNSE[32018:18691541] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.606 RiotNSE[32018:18692610] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.612 RiotNSE[32018:18693938] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI
2021-05-14 16:31:33.614 RiotNSE[32018:18684499] [MXRealmCryptoStore] initWithCredentials for @alice:matrix.org:ABCDEFGHI

Meanwhile, in app logs, we had:

2021-05-14 14:58:07.392 Riot[31806:18430022] [MXFileStore commit] lasted 4ms
2021-05-14 14:58:07.392 Riot[31806:18430022] [MXBackgroundTask] Stop background task #681 - [MXFileStore commit] after 4ms
XXXX
2021-05-14 16:31:33.517 Riot[31806:18430022] [AppDelegate] applicationWillEnterForeground

XXXX shows the synchronisation point between the app and the NSE

@ismailgulek
Copy link
Contributor

We hope matrix-org/matrix-ios-sdk#1106 will fix this. Will be reopened if still seen in the upcoming releases.

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

No branches or pull requests

2 participants