From 0719a39ee470675e0d93c4a0204be2ae6555a435 Mon Sep 17 00:00:00 2001 From: yangxuan Date: Mon, 24 Jul 2023 15:34:14 +0800 Subject: [PATCH] Donot retry on RESOURCE_EXHAUSTED See also: milvus-io/milvus#25695 Signed-off-by: yangxuan --- pymilvus/client/grpc_handler.py | 2 +- pymilvus/decorators.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pymilvus/client/grpc_handler.py b/pymilvus/client/grpc_handler.py index d7b8ba84c..f34679479 100644 --- a/pymilvus/client/grpc_handler.py +++ b/pymilvus/client/grpc_handler.py @@ -721,7 +721,7 @@ def create_index( if field_name != fields["name"]: continue valid_field = True - if fields["type"] != DataType.FLOAT_VECTOR and fields["type"] != DataType.BINARY_VECTOR: + if fields["type"] not in {DataType.FLOAT_VECTOR, DataType.BINARY_VECTOR}: break if not valid_field: diff --git a/pymilvus/decorators.py b/pymilvus/decorators.py index d9b993ab3..f3d33fdc8 100644 --- a/pymilvus/decorators.py +++ b/pymilvus/decorators.py @@ -74,6 +74,7 @@ def timeout(start_time: Optional[float] = None) -> bool: grpc.StatusCode.UNAUTHENTICATED, grpc.StatusCode.INVALID_ARGUMENT, grpc.StatusCode.ALREADY_EXISTS, + grpc.StatusCode.RESOURCE_EXHAUSTED, ): raise MilvusException(message=str(e)) from e if timeout(start_time):