Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
r/consensus: acquire lock when waiting for gate to be closed
When raft stops the last step in stop sequence is closing gate. After gate is closed all the background futures are guaranteed to be finished. However it may happen that the fiber is waiting for an `_op_lock` while gate is being closed. We need to make sure that when the `_op_lock` is acquired the `consensus` instance is still alive. Clearing and marking an oplock as broken after dispatching `gate` close makes it impossible for incoming fibers to access `consensus` after it is deleted. Signed-off-by: Michal Maslanka <michal@redpanda.com>
- Loading branch information