From 869f664a4f9ce90a943e2e064e7f97665aacf736 Mon Sep 17 00:00:00 2001 From: Jiquan Long Date: Fri, 12 Apr 2024 10:45:13 +0800 Subject: [PATCH] Revert "enhance: retry on inconsistent requery (#1975)" (#2039) Reverts milvus-io/pymilvus#1976 --- pymilvus/client/grpc_handler.py | 2 +- pymilvus/decorators.py | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/pymilvus/client/grpc_handler.py b/pymilvus/client/grpc_handler.py index cfc234467..bd251731b 100644 --- a/pymilvus/client/grpc_handler.py +++ b/pymilvus/client/grpc_handler.py @@ -734,7 +734,7 @@ def _execute_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, 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)