mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 03:18:29 +08:00
commit
adccd3dbf0
@ -83,3 +83,9 @@ def DBErrorHandler(err):
|
||||
def InvalidArgumentErrorHandler(err):
|
||||
logger.error(err)
|
||||
return resp_handler(err, status_pb2.ILLEGAL_RANGE)
|
||||
|
||||
|
||||
@server.errorhandler(exceptions.ConnectionNotFoundError)
|
||||
def InvalidArgumentErrorHandler(err):
|
||||
logger.error(err)
|
||||
return resp_handler(err, status_pb2.UNEXPECTED_ERROR)
|
||||
|
@ -17,8 +17,19 @@ class RouterMixin:
|
||||
return conn.conn
|
||||
|
||||
def query_conn(self, name, metadata=None):
|
||||
conn = self.readonly_topo.get_group(name).get(name).fetch()
|
||||
if not name:
|
||||
raise exceptions.ConnectionNotFoundError(
|
||||
message=f'Conn Group is Empty. Please Check your configurations',
|
||||
metadata=metadata)
|
||||
|
||||
group = self.readonly_topo.get_group(name)
|
||||
if not group:
|
||||
raise exceptions.ConnectionNotFoundError(
|
||||
message=f'Conn Group {name} is Empty. Please Check your configurations',
|
||||
metadata=metadata)
|
||||
conn = group.get(name).fetch()
|
||||
if not conn:
|
||||
raise exceptions.ConnectionNotFoundError(name, metadata=metadata)
|
||||
raise exceptions.ConnectionNotFoundError(
|
||||
message=f'Conn {name} Not Found', metadata=metadata)
|
||||
conn.on_connect(metadata=metadata)
|
||||
return conn
|
||||
|
@ -8,6 +8,7 @@ from urllib.parse import urlparse
|
||||
from functools import wraps
|
||||
from concurrent import futures
|
||||
from grpc._cython import cygrpc
|
||||
import milvus
|
||||
from milvus.grpc_gen.milvus_pb2_grpc import add_MilvusServiceServicer_to_server
|
||||
from mishards.grpc_utils import is_grpc_method
|
||||
from mishards.service_handler import ServiceHandler
|
||||
@ -109,6 +110,8 @@ class Server:
|
||||
sys.exit(1)
|
||||
|
||||
self.start(port)
|
||||
logger.info(f'Server Version: {settings.SERVER_VERSIONS[-1]}')
|
||||
logger.info(f'Python SDK Version: {milvus.__version__}')
|
||||
logger.info('Listening on port {}'.format(port))
|
||||
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user