mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #6857 from LK4D4/non_block_status
raft: return empty status if node is stopped
This commit is contained in:
commit
377f19b003
@ -462,8 +462,12 @@ func (n *node) ApplyConfChange(cc pb.ConfChange) *pb.ConfState {
|
||||
|
||||
func (n *node) Status() Status {
|
||||
c := make(chan Status)
|
||||
n.status <- c
|
||||
select {
|
||||
case n.status <- c:
|
||||
return <-c
|
||||
case <-n.done:
|
||||
return Status{}
|
||||
}
|
||||
}
|
||||
|
||||
func (n *node) ReportUnreachable(id uint64) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user