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

Scary (but harmless) warnings when transaction streams and connections are closed #397

Open
da-tanabe opened this issue Feb 16, 2023 · 0 comments

Comments

@da-tanabe
Copy link
Contributor

These usually happy when the connection is being closed while it's still trying to serve a stream:

async def find_first_event():
    async with connect(...) as conn:
        async with conn.query(...) as stream:
            async for ev in stream:
                return ev

In this case, the stream is broken because each context (async with) is closed, and dazl and grpcio aren't quite smart enough to suppress CancelledError exceptions when in-use streams are open against an underlying channel that is also being closed.

Ideally nothing would be logged in this case, because the errors aren't actually errors—they're just objects that are naturally being closed. Unfortunately Python signals "normal" flow using exceptions sometimes, and so some special handling has to happen somewhere to prevent these expected exceptions from being logged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant