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

AsyncSchemaRegistryClient is unable to handle concurrent requests #115

Open
thiromi opened this issue Dec 13, 2021 · 9 comments
Open

AsyncSchemaRegistryClient is unable to handle concurrent requests #115

thiromi opened this issue Dec 13, 2021 · 9 comments

Comments

@thiromi
Copy link
Contributor

thiromi commented Dec 13, 2021

Describe the bug

Related to encode/httpx#1478, I'm getting this exception while using the same instance of AsyncSchemaRegistryClient in two different places, raising httpx.RemoteProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE. The source code of the client is similar to the example that shows how to reproduce the issue in httpx and the answer to this comment mentions using the context manager once at a time would be the fix to it.

I could manage to overcome this issue by creating one instance of the client for every class that depends on AsyncSchemaRegistryClient

To Reproduce
Steps to reproduce the behavior:

I'll need some time to write a small snippet to reproduce it, so bear with me 😬

Expected behavior

The client is able to handle two (or more) concurrent calls to the schema registry

@marcosschroh
Copy link
Owner

Hi @thiromi

I think after merging this PR #117 the issue will be solved

@marcosschroh
Copy link
Owner

@thiromi can you check whether with the latest version this issue is fixed?

@thiromi
Copy link
Contributor Author

thiromi commented Feb 10, 2022

@marcosschroh I'll try it and let you know 👍

@bradydean
Copy link

@thiromi Did #117 fix your issue?

@thiromi
Copy link
Contributor Author

thiromi commented Mar 29, 2022

@marcosschroh sorry for the wait, but meh, I still face

httpx.RemoteProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE

cc @bradydean

@bradydean
Copy link

@thiromi Are you using the same client object from different threads or asyncio tasks? Just curious as I'm about to start development using this library.

@thiromi
Copy link
Contributor Author

thiromi commented Mar 30, 2022

@bradydean I'm using the same client from asyncio tasks

@marcosschroh
Copy link
Owner

According to httpx this error happens when Server closed without sending response. In one of the latest versions of httpx a warning was added related to this and the error message was improved. Which httpx version are you using?

@thiromi
Copy link
Contributor Author

thiromi commented Apr 11, 2022

@marcosschroh I'm using httpx==0.22.0

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

3 participants