MCPcopy
hub / github.com/etcd-io/etcd / ConcurrentStop

Method ConcurrentStop

tests/framework/e2e/cluster.go:1054–1075  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1052}
1053
1054func (epc *EtcdProcessCluster) ConcurrentStop() (err error) {
1055 errCh := make(chan error, len(epc.Procs))
1056 for i := range epc.Procs {
1057 if epc.Procs[i] == nil {
1058 errCh <- nil
1059 continue
1060 }
1061 go func(n int) { errCh <- epc.Procs[n].Stop() }(i)
1062 }
1063
1064 for range epc.Procs {
1065 if curErr := <-errCh; curErr != nil {
1066 if err != nil {
1067 err = fmt.Errorf("%w; %w", err, curErr)
1068 } else {
1069 err = curErr
1070 }
1071 }
1072 }
1073 close(errCh)
1074 return err
1075}
1076
1077func (epc *EtcdProcessCluster) Etcdctl(opts ...config.ClientOption) *EtcdctlV3 {
1078 etcdctl, err := NewEtcdctl(epc.Cfg.Client, epc.EndpointsGRPC(), opts...)

Callers 1

forcestopClusterFunction · 0.80

Calls 2

StopMethod · 0.65
ErrorfMethod · 0.65

Tested by 1

forcestopClusterFunction · 0.64