func (mc *membershipCache) stop() error {
	mc.membership.stop()

	mc.raftIdToRaftBackend.Range(func(key, value interface{}) bool {
		backend := value.(*raftBackend)
		defer backend.stop()
		return true
	})

	mc.addressToConnection.Range(func(key, value interface{}) bool {
		conn := value.(*grpc.ClientConn)
		defer conn.Close()
		return true
	})

	return nil
}
// This is a best-effort stop.
// Other go routines could come in and create new backends or connections
// at the same time.
This is a best-effort stop.
Other go routines could come in and create new backends or connections
at the same time.
// This is a best - effort stop . // Other go routines could come in and create new backends or connections // at the same time .
func (mc *membershipCache) stop() error {
	mc.membership.stop()
	mc.raftIdToRaftBackend.Range(func(key, value interface{}) bool {
		backend := value.(*raftBackend)
		defer backend.stop()
		return true
	})
	mc.addressToConnection.Range(func(key, value interface{}) bool {
		conn := value.(*grpc.ClientConn)
		defer conn.Close()
		return true
	})
	return nil
}
func ( mc * membershipCache ) stop ( ) error { mc . membership . stop ( ) mc . raftIdToRaftBackend . Range ( func ( key , value interface { } ) bool { backend := value . ( * raftBackend ) defer backend . stop ( ) return true } ) mc . addressToConnection . Range ( func ( key , value interface { } ) bool { conn := value . ( * grpc . ClientConn ) defer conn . Close ( ) return true } ) return nil }
This is a best-effort stop.
This is a best - effort stop .