Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: Raise exception if RPC error occurs #2072

Open
1 task done
emanueledomingo opened this issue May 7, 2024 · 0 comments
Open
1 task done

[Enhancement]: Raise exception if RPC error occurs #2072

emanueledomingo opened this issue May 7, 2024 · 0 comments
Labels
kind/enhancement New feature or request

Comments

@emanueledomingo
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

What would you like to be added?

If method of the client fail due to an RPC error, raise a MilvusException instead of freezing the excution.

For example, if i call .insert() on a collection does not exists:

try:
    client = MilvusClient(
        uri="...",
        db_name="...",
    )
except Exception as ex:
    logger.exception(ex)
    raise Exception("[Error] Unable to connect to Milvus")
try:
    client.insert(
        collection_name="not-existing-collection",
        data={...},
    )
except Exception as ex:
    # Never enters here!
    logger.exception(ex)
    raise Exception("[Error] Unable to insert data to Milvus")
finally:
    client.close()

i see in the logs:

RPC error: [describe_collection], <DescribeCollectionException: (code=100, message=can't find collection collection not found[database=db_d15830d434f6fa2][collection=articles_preference])>, <Time:{'RPC start': '2024-05-06 12:54:56.493406', 'RPC error': '2024-05-06 12:54:56.519075'}>
RPC error: [insert_rows], <DescribeCollectionException: (code=100, message=can't find collection collection not found[database=db_d15830d434f6fa2][collection=articles_preference])>, <Time:{'RPC start': '2024-05-06 12:54:56.493382', 'RPC error': '2024-05-06 12:54:56.519235'}>

But the execution does not stop, resulting in an infine loop (at least, more than 10 minutes).

Why is this needed?

This blocks the execution if an error occurs without possibility to intercept the error.

Anything else?

No response

@emanueledomingo emanueledomingo added the kind/enhancement New feature or request label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant