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

Storage: implement read/write locks for calls to the LMDB backend #148

Open
chisa0a opened this issue Jun 13, 2019 · 3 comments
Open

Storage: implement read/write locks for calls to the LMDB backend #148

chisa0a opened this issue Jun 13, 2019 · 3 comments

Comments

@chisa0a
Copy link

chisa0a commented Jun 13, 2019

Possibly related to grin/issue#2868, only one caller should have write access to the wallet db at once. If possible, multiple readers can be allowed with a read-write lock.

This would eliminate implementer/users needing to be concerned with the warning about single-access during check_restore. With a read-write lock, write calls will need to wait on the lock, but multiple reader calls can be made simultaneously.

Another possibility (discussed with @bladedoyle and @DavidBurkett on gitter) is to implement a file-based lock that is acquired by check_restore, disallowing access by any other callers.

@bladedoyle
Copy link

This may be related to wallet (non)locking: mimblewimble/grin#2868

@yeastplume
Copy link
Member

I think this may be desirable to do as part of #244, however there isn't currently any clean delineation in the code between what operations update and what operations just read. (All operations do a mix of both) I think it might be better to consider update/send/restore etc as atomic operations and put all other attempts to perform operations on hold until each is complete.

@lehnberg lehnberg added the P3: Fix if time Nice to have, does not block release label Oct 30, 2019
@lehnberg lehnberg added this to the 3.0.0 milestone Oct 30, 2019
@lehnberg lehnberg removed this from the 3.0.0 milestone Nov 26, 2019
@lehnberg lehnberg removed the P3: Fix if time Nice to have, does not block release label Nov 26, 2019
@lehnberg
Copy link
Collaborator

This has been de-scoped of 3.0.0 following dev meeting today.

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

No branches or pull requests

4 participants