Explorar el Código

Merge pull request #3880 from xiang90/fix_stop

etcdmain: fix unstoppable startEtcd function
Xiang Li hace 10 años
padre
commit
c0353697da
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      etcdmain/etcd.go

+ 1 - 1
etcdmain/etcd.go

@@ -323,7 +323,7 @@ func startEtcd(cfg *config) (<-chan struct{}, error) {
 		grpcServer := grpc.NewServer()
 		grpcServer := grpc.NewServer()
 		etcdserverpb.RegisterKVServer(grpcServer, v3rpc.NewKVServer(s))
 		etcdserverpb.RegisterKVServer(grpcServer, v3rpc.NewKVServer(s))
 		etcdserverpb.RegisterWatchServer(grpcServer, v3rpc.NewWatchServer(s.Watchable()))
 		etcdserverpb.RegisterWatchServer(grpcServer, v3rpc.NewWatchServer(s.Watchable()))
-		go plog.Fatal(grpcServer.Serve(v3l))
+		go func() { plog.Fatal(grpcServer.Serve(v3l)) }()
 	}
 	}
 
 
 	return s.StopNotify(), nil
 	return s.StopNotify(), nil