From e0f0e91e64f25991610d5b4f12caa941a7ee2748 Mon Sep 17 00:00:00 2001 From: Jiquan Long Date: Fri, 12 Apr 2024 10:43:13 +0800 Subject: [PATCH] Revert "enhance: retry on inconsistent requery" (#2038) Reverts milvus-io/pymilvus#1975 --- pymilvus/client/grpc_handler.py | 4 ++-- pymilvus/decorators.py | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/pymilvus/client/grpc_handler.py b/pymilvus/client/grpc_handler.py index 460529e1c..d6fcc4fc5 100644 --- a/pymilvus/client/grpc_handler.py +++ b/pymilvus/client/grpc_handler.py @@ -756,7 +756,7 @@ def _execute_hybrid_search( return SearchFuture(None, None, e) raise e from e - @retry_on_rpc_failure(retry_on_inconsistent_requery=True) + @retry_on_rpc_failure() def search( self, collection_name: str, @@ -796,7 +796,7 @@ def search( ) return self._execute_search(request, timeout, round_decimal=round_decimal, **kwargs) - @retry_on_rpc_failure(retry_on_inconsistent_requery=True) + @retry_on_rpc_failure() def hybrid_search( self, collection_name: str, diff --git a/pymilvus/decorators.py b/pymilvus/decorators.py index 980e046a5..e897c3405 100644 --- a/pymilvus/decorators.py +++ b/pymilvus/decorators.py @@ -45,7 +45,6 @@ def retry_on_rpc_failure( initial_back_off: float = 0.01, max_back_off: float = 3, back_off_multiplier: int = 3, - retry_on_inconsistent_requery: bool = False, ): def wrapper(func: Any): @functools.wraps(func) @@ -107,14 +106,8 @@ def timeout(start_time: Optional[float] = None) -> bool: raise MilvusException( code=e.code, message=f"{to_msg}, message={e.message}" ) from e - if ( - _retry_on_rate_limit - and ( - e.code == ErrorCode.RATE_LIMIT - or e.compatible_code == common_pb2.RateLimit - ) - or retry_on_inconsistent_requery - and e.code == 2200 + if _retry_on_rate_limit and ( + e.code == ErrorCode.RATE_LIMIT or e.compatible_code == common_pb2.RateLimit ): time.sleep(back_off) back_off = min(back_off * back_off_multiplier, max_back_off)