Browse Source

chore(peer_server): adjust code to make it more clear

Yicheng Qin 11 years ago
parent
commit
5c7a963cf0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      server/peer_server.go

+ 1 - 1
server/peer_server.go

@@ -321,10 +321,10 @@ func (s *PeerServer) asyncRemove() {
 	// TODO(yichengq): it should also call async stop for raft server,
 	// TODO(yichengq): it should also call async stop for raft server,
 	// but this functionality has not been implemented.
 	// but this functionality has not been implemented.
 	go func() {
 	go func() {
-		defer s.Unlock()
 		s.raftServer.Stop()
 		s.raftServer.Stop()
 		s.routineGroup.Wait()
 		s.routineGroup.Wait()
 		close(s.removeNotify)
 		close(s.removeNotify)
+		s.Unlock()
 	}()
 	}()
 }
 }