mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
server&tests: Fix goroutine leaks
This commit is contained in:
parent
4f34f14830
commit
3de6b382df
@ -218,7 +218,7 @@ func startGRPCProxy(cmd *cobra.Command, args []string) {
|
||||
httpClient := mustNewHTTPClient(lg)
|
||||
|
||||
srvhttp, httpl := mustHTTPListener(lg, m, tlsinfo, client, proxyClient)
|
||||
errc := make(chan error)
|
||||
errc := make(chan error, 3)
|
||||
go func() { errc <- newGRPCProxyServer(lg, client).Serve(grpcl) }()
|
||||
go func() { errc <- srvhttp.Serve(httpl) }()
|
||||
go func() { errc <- m.Serve() }()
|
||||
|
@ -260,7 +260,7 @@ func restoreCluster(t *testing.T, clusterN int, dbPath string) (
|
||||
cfgs[i] = cfg
|
||||
}
|
||||
|
||||
sch := make(chan *embed.Etcd)
|
||||
sch := make(chan *embed.Etcd, len(cfgs))
|
||||
for i := range cfgs {
|
||||
go func(idx int) {
|
||||
srv, err := embed.StartEtcd(cfgs[idx])
|
||||
|
Loading…
x
Reference in New Issue
Block a user