integration/cluster.go
func (m *member) Restart(t testing.TB) error {
	lg.Info(
		"restarting a member",
		zap.String("name", m.Name),
		zap.Strings("advertise-peer-urls", m.PeerURLs.StringSlice()),
		zap.Strings("listen-client-urls", m.ClientURLs.StringSlice()),
		zap.String("grpc-address", m.grpcAddr),
	)
	newPeerListeners := make([]net.Listener, 0)
	for _, ln := range m.PeerListeners {
		newPeerListeners = append(newPeerListeners, NewListenerWithAddr(t, ln.Addr().String()))
	}
	m.PeerListeners = newPeerListeners
	newClientListeners := make([]net.Listener, 0)
	for _, ln := range m.ClientListeners {
		newClientListeners = append(newClientListeners, NewListenerWithAddr(t, ln.Addr().String()))
	}
	m.ClientListeners = newClientListeners

	if m.grpcListener != nil {
		if err := m.listenGRPC(); err != nil {
			t.Fatal(err)
		}
	}

	err := m.Launch()
	lg.Info(
		"restarted a member",
		zap.String("name", m.Name),
		zap.Strings("advertise-peer-urls", m.PeerURLs.StringSlice()),
		zap.Strings("listen-client-urls", m.ClientURLs.StringSlice()),
		zap.String("grpc-address", m.grpcAddr),
		zap.Error(err),
	)
	return err
}
func (m *member) Restart(t testing.TB) error {
	lg.Info(
		"restarting a member",
		zap.String("name", m.Name),
		zap.Strings("advertise-peer-urls", m.PeerURLs.StringSlice()),
		zap.Strings("listen-client-urls", m.ClientURLs.StringSlice()),
		zap.String("grpc-address", m.grpcAddr),
	)
	newPeerListeners := make([]net.Listener, 0)
	for _, ln := range m.PeerListeners {
		newPeerListeners = append(newPeerListeners, NewListenerWithAddr(t, ln.Addr().String()))
	}
	m.PeerListeners = newPeerListeners
	newClientListeners := make([]net.Listener, 0)
	for _, ln := range m.ClientListeners {
		newClientListeners = append(newClientListeners, NewListenerWithAddr(t, ln.Addr().String()))
	}
	m.ClientListeners = newClientListeners

	if m.grpcListener != nil {
		if err := m.listenGRPC(); err != nil {
			t.Fatal(err)
		}
	}

	err := m.Launch()
	lg.Info(
		"restarted a member",
		zap.String("name", m.Name),
		zap.Strings("advertise-peer-urls", m.PeerURLs.StringSlice()),
		zap.Strings("listen-client-urls", m.ClientURLs.StringSlice()),
		zap.String("grpc-address", m.grpcAddr),
		zap.Error(err),
	)
	return err
}
func ( m * member ) Restart ( t testing . TB ) error { lg . Info ( " " , zap . String ( " " , m . Name ) , zap . Strings ( " " , m . PeerURLs . StringSlice ( ) ) , zap . Strings ( " " , m . ClientURLs . StringSlice ( ) ) , zap . String ( " " , m . grpcAddr ) , ) newPeerListeners := make ( [ ] net . Listener , 0 ) for _ , ln := range m . PeerListeners { newPeerListeners = append ( newPeerListeners , NewListenerWithAddr ( t , ln . Addr ( ) . String ( ) ) ) } m . PeerListeners = newPeerListeners newClientListeners := make ( [ ] net . Listener , 0 ) for _ , ln := range m . ClientListeners { newClientListeners = append ( newClientListeners , NewListenerWithAddr ( t , ln . Addr ( ) . String ( ) ) ) } m . ClientListeners = newClientListeners if m . grpcListener != nil { if err := m . listenGRPC ( ) ; err != nil { t . Fatal ( err ) } } err := m . Launch ( ) lg . Info ( " " , zap . String ( " " , m . Name ) , zap . Strings ( " " , m . PeerURLs . StringSlice ( ) ) , zap . Strings ( " " , m . ClientURLs . StringSlice ( ) ) , zap . String ( " " , m . grpcAddr ) , zap . Error ( err ) , ) return err }
// Restart starts the member using the preserved data dir.
Restart starts the member using the preserved data dir .