Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Makes sure a write lock can be avoided when launching an inactive_node #1967

Merged

Conversation

wezrule
Copy link
Contributor

@wezrule wezrule commented May 8, 2019

CLI commands can currently open a write lock on the ledger database when they don't need to. When using --fast_bootstrap and aren't synced yet or if there is any other long write transaction running, simple commands like nano_node --wallet_create can end up taking a few minutes. A few places where writes were being used are now checked in a pre-pass by using a read transaction to see whether the write is actually required (after first initialization of the ledger, they generally aren't needed).

I found that the read transaction needs to be committed when opening databases (not sure why), but I've replaced abort with that. This is also what it is prior to #1951.

@wezrule wezrule added the quality improvements This item indicates the need for or supplies changes that improve maintainability label May 8, 2019
@wezrule wezrule added this to the V19.0 milestone May 8, 2019
@wezrule wezrule requested a review from cryptocode May 8, 2019 08:44
@wezrule wezrule self-assigned this May 8, 2019
Copy link
Contributor

@cryptocode cryptocode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wezrule wezrule merged commit 6ca0699 into nanocurrency:master May 9, 2019
@wezrule wezrule deleted the remote_write_lock_inactive_node branch May 9, 2019 14:20
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
quality improvements This item indicates the need for or supplies changes that improve maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants