Skip to content

Commit

Permalink
Problem: fireEvents can runs asyncously
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Nov 1, 2024
1 parent 05dc302 commit 7894fd4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,11 @@ func (blockExec *BlockExecutor) applyBlock(state State, blockID types.BlockID, b
}
}

// Events are fired after everything else.
// NOTE: if we crash between Commit and Save, events wont be fired during replay
fireEvents(blockExec.logger, blockExec.eventBus, block, blockID, abciResponse, validatorUpdates)
if _, ok := blockExec.eventBus.(types.NopEventBus); !ok {
// Events are fired after everything else.
// NOTE: if we crash between Commit and Save, events wont be fired during replay
go fireEvents(blockExec.logger, blockExec.eventBus, block, blockID, abciResponse, validatorUpdates)
}

return state, nil
}
Expand Down

0 comments on commit 7894fd4

Please sign in to comment.