Skip to content

Fix race condition on stream.read - #535

Merged
florimondmanca merged 2 commits into
masterfrom
fix/concurrent-read
Nov 22, 2019
Merged

florimondmanca merged 2 commits into
masterfrom
fix/concurrent-read

Conversation

@florimondmanca

@florimondmanca florimondmanca commented Nov 17, 2019 •

Copy link
Copy Markdown
Contributor

Fixes #527

Turns out that the bug was also present on trio, so I added a fix and test for it too.

I'm not sure that we'd also need a lock around the asyncio write operation (we already have one on trio), but no bug was reported yet and we should probably investigate that separately anyway.

@florimondmanca florimondmanca added http/2 Issues and PRs related to HTTP/2 concurrency Issues related to concurrency and usage of async libraries labels Nov 17, 2019
@florimondmanca
florimondmanca requested a review from a team November 17, 2019 11:39

@yeraydiazdiaz yeraydiazdiaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a minor nit. Thanks! 馃専

Comment thread tests/concurrency.py Outdated
@florimondmanca

Copy link
Copy Markdown
Contributor Author

Thanks for the review @yeraydiazdiaz!

@florimondmanca
florimondmanca merged commit a05ba2e into master Nov 22, 2019
@florimondmanca
florimondmanca deleted the fix/concurrent-read branch November 22, 2019 08:34
Kludex referenced this pull request in pydantic/httpx2 May 11, 2026
* Remove Python 3.6 related code
* Remove Python 3.6 from matrix strategy
* Unpin `twine` version
* Bump `black` version
* Make black target version 3.7
* Unpin `wheel` dependency
* Bump `mkdocs` to 1.3.0
* Unpin `mkdocs`
* Downpin flake8 to 3.9.2
* Pin Jinja2 to 3.0.3
* Attempt: bump pytest-httpbin to 1.0.2
* Pin werkzeug
* Add note about 3.7+ in README/docs

Co-authored-by: Michael Oliver <michael@michaeloliver.dev>
Co-authored-by: Florimond Manca <florimond.manca@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

concurrency Issues related to concurrency and usage of async libraries http/2 Issues and PRs related to HTTP/2

Development

Successfully merging this pull request may close these issues.

Python 3.7: RuntimeError: read() called while another coroutine is already waiting for incoming data

2 participants