Browse Source

etcdserver: stop raft after stopping apply scheduler

Was causing a pipeline leak.
Anthony Romano 9 years ago
parent
commit
08d879341d
1 changed files with 4 additions and 1 deletions
  1. 4 1
      etcdserver/server.go

+ 4 - 1
etcdserver/server.go

@@ -537,9 +537,12 @@ func (s *EtcdServer) run() {
 	}
 	}
 
 
 	defer func() {
 	defer func() {
-		s.r.stop()
 		sched.Stop()
 		sched.Stop()
 
 
+		// must stop raft after scheduler-- etcdserver can leak rafthttp pipelines
+		// by adding a peer after raft stops the transport
+		s.r.stop()
+
 		s.wg.Wait()
 		s.wg.Wait()
 
 
 		// kv, lessor and backend can be nil if running without v3 enabled
 		// kv, lessor and backend can be nil if running without v3 enabled