-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3399: Reduce database blocking in light-mode r=HeinrichApfelmus a=HeinrichApfelmus ### Issue number ADP-2012 ### Overview This pull request fixes an issue in light-mode where a lock on the database was kept while fetching transactions from an external blockchain data source. ### Details * The field `atomically` of the `DBLayer` allows us to do atomic database operations. * Instead of wrapping the entire body of `restoreBlocks` into a call to `atomically`, we now wrap the reading and writing separately. * In principle, this could lead to trouble when two calls to `restoreBlocks` interleave — the checkpoint which we have read need no longer agree with the one we are writing to. * However, the old code also assumes that the calls to `restoreBlocks` are not interleaved. More generally, we expect that the callbacks stored in a `ChainFollower` are called sequentially. Co-authored-by: Heinrich Apfelmus <[email protected]>
- Loading branch information
Showing
1 changed file
with
29 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters