Skip to content

Commit

Permalink
Merge branch 'master' of github.com:milvus-io/pymilvus into 2404-floa…
Browse files Browse the repository at this point in the history
…t-array-bw
  • Loading branch information
bigsheeper committed Apr 12, 2024
2 parents a9eb5d1 + e0f0e91 commit dffbbf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pymilvus/client/grpc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
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 dffbbf0

Please sign in to comment.