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

🔧 Avoid blocking when reading data from request stream #364

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GQMai
Copy link

@GQMai GQMai commented Aug 29, 2019

The following call can block under certain WSGI servers which implements only PEP 333 not PEP 3333
request.stream.read()
It can be avoided by changing it to
request.stream.read(request.content_length or 0)

Reference:
https://falcon.readthedocs.io/en/stable/api/request_and_response.html
https://stackoverflow.com/questions/22894078/why-does-environwsgi-input-read-block-even-though-it-is-allowed-by-pep-333?answertab=oldest#tab-top

@GQMai GQMai changed the title 🔧 Avoid blocking when reading data from request stream 🔧 Avoid blocking when reading data from request stream Aug 29, 2019
@madchutney
Copy link
Contributor

madchutney commented Sep 13, 2019

@GQMai Thanks for the fix. Can you please add a news file for the release notes, e.g. docs/news/20190829.doc and mention this is a fix to an example, thanks.

Please note that this example should never be used for production environments.

@GQMai
Copy link
Author

GQMai commented Sep 16, 2019

@GQMai Thanks for the fix. Can you please add a news file for the release notes, e.g. docs/news/20190829.doc and mention this is a fix to an example, thanks.

Please note that this example should never be used for production environments.

Sure. It's done.
Thanks.

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

Successfully merging this pull request may close these issues.

2 participants