fix race condition

pull/5602/head
Cory LaNou 2016-02-10 21:27:07 -06:00 committed by Jason Wilder
parent e9a2c33556
commit 52077b2dfc
1 changed files with 2 additions and 0 deletions

View File

@ -168,6 +168,8 @@ func (s *store) setOpen() error {
// peers returns the raft peers known to this store
func (s *store) peers() []string {
s.mu.RLock()
defer s.mu.RUnlock()
if s.raftState == nil {
return []string{s.raftAddr}
}