Skip to content

Commit

Permalink
Revert "enhance: retry on inconsistent requery (#1975)" (#2039)
Browse files Browse the repository at this point in the history
Reverts #1976
  • Loading branch information
longjiquan authored Apr 12, 2024
1 parent bf2c27d commit 869f664
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pymilvus/client/grpc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 2 additions & 9 deletions pymilvus/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 869f664

Please sign in to comment.