Skip to content

Rely solely on CrossProcessLock to manage leases in CryptoStore #6269

@mgoldenberg

Description

@mgoldenberg

When trying to obtain a CrossProcessLock on the CryptoStore, Encryption::try_lock_store_once uses OlmMachine to maintain a custom database value in the CryptoStore. However, this is not necessary, as CrossProcessLock already manages leased locks in the database.

Furthermore, Encryption::try_lock_store_once ignores the CrossProcessLockState and makes it's own determination of whether the lock is dirty. This should also be changed such that it relies on the dirtiness mechanism exposed by CrossProcessLock, and when dirty, the OlmMachine should simply be regenerated.

Note that this should also apply to EncryptionStore::spin_lock_store.


It may also be useful to encapsulate some of this behavior in a CryptoStoreLock akin to, e.g., EventCacheStoreLock.


This seems like it is likely related to #3313.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions