-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
abci: use a semaphore for commit/apply/beginblock (#196)
Consensus method requests from cometbft are synchronous, but a portion of the work of Commit is launched in a goroutine, so we block a subsequent BeginBlock from starting new changes. We do this by acquiring a semaphore with max concurrency of 1 at the start of BeginBlock, and releasing it when the changes from Commit have finished applying. A mutex is rarely held for longer than the duration of a local function, while a waitgroup does not provide atomic Wait/Add semantics that fit here. Co-authored-by: Brennan Lamey <[email protected]>
- Loading branch information
1 parent
b7753dd
commit 490e9a5
Showing
1 changed file
with
11 additions
and
14 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