marcosschroh / marcosschroh/python-schema-registry-client
AsyncSchemaRegistryClient is unable to handle concurrent requests
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 178
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Related to https://github.com/encode/httpx/issues/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](https://github.com/encode/httpx/issues/1478#issuecomment-828955977) and the [answer to this comment](https://github.com/encode/httpx/issues/1478#issuecomment-829132394) 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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the AsyncSchemaRegistryClient entry point and review how its shared client or context manager is used during concurrent calls. Use the linked HTTPX reproduction and discussion as context, then create a concurrent reproduction before changing behavior. Done means one shared client can handle two or more concurrent schema-registry calls without the reported RemoteProtocolError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100