Page MenuHomePhabricator

[native] Run initializeCryptoAccount once at a time
ClosedPublic

Authored by ashoat on Sep 30 2024, 11:19 AM.
Tags
None
Referenced Files
F3337411: D13523.diff
Thu, Nov 21, 4:34 PM
Unknown Object (File)
Tue, Nov 12, 10:40 AM
Unknown Object (File)
Tue, Nov 12, 10:40 AM
Unknown Object (File)
Tue, Nov 12, 10:37 AM
Unknown Object (File)
Tue, Nov 12, 10:07 AM
Unknown Object (File)
Fri, Nov 1, 4:23 PM
Unknown Object (File)
Fri, Nov 1, 4:23 PM
Unknown Object (File)
Fri, Nov 1, 4:22 PM
Subscribers
None

Details

Summary

In ENG-9416, we discovered an issue that can be caused when a bunch of initializeCryptoAccount operations clog up the crypto thread queue. They can be rather slow, and when multiple are enqueued at the same time, they can result in data from one call being replaced by data from another.

To avoid these risks, this diff makes sure we only call initializeCryptoAccount once at a time.

Test Plan

I added logs to initializeCryptoAccount and createOlmSessionsWithUser. Before this diff, when we needed to construct Olm sessions for multiple users, each createOlmSessionsWithUser call would result in a initializeCryptoAccount call. After this diff, there is only one initializeCryptoAccount call for all of the createOlmSessionsWithUser calls.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Changing reviewers so we can land this today before the launch build

This revision is now accepted and ready to land.Sep 30 2024, 12:04 PM