-
-
Notifications
You must be signed in to change notification settings - Fork 760
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
Use a2wsgi.WSGIMiddleware replace WSGIMiddleware #1303
Conversation
@@ -62,6 +62,7 @@ def get_packages(package): | |||
"watchgod>=0.6", | |||
"python-dotenv>=0.13", | |||
"PyYAML>=5.1", | |||
"a2wsgi>=1.4.0,<2.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only question here is: should this go in extra_requirements
so that people have it when installing via pip install uvicorn[standard]
or directly in the minimal_requirements
section ?
the idea of uvicorn[standard]
vs uvicorn
was in summary cpython vs pure-python, or high-speed vs minimal, so I'd thought we better put it in minimal_requirements instead but I'm open on anything really
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we think Uvicorn can be used as a WSGI Server, then it should be added to minimal_requirements.
But in README:
Uvicorn is an ASGI web server implementation for Python.
So I'm not so sure...
What are @tomchristie 's thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add it in the docs and then close #177
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree.
@@ -28,12 +28,21 @@ | |||
# enable this functionality. | |||
pass | |||
|
|||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depending on the answer to the comment above @abersheeran the try / catch may not be necessary
This could be a good idea. The first thing to do in order for us to make a decision would be to have a clearer user-facing description here. |
It is worth mentioning that in #371 (comment) , the test results of a2wsgi are almost the same as those of ASGI. |
and the from OP's tests the fix in #1329 worsen the situation |
some tests, on master:
on this branch:
~~ you can reproduce with creating the files: having
then
and then curl with |
Okay. We've two options...
In general I'd prefer we aim towards fewer dependancies. 🤷♂️ |
Hm, it sounds strange @euri10 as I've verified that my branch does fix the issue, and your results are suspiciously similar to the OTOH, my branch is just a quickfix for quadratic explosion while still buffering into a bytestring; @abersheeran's middleware does it "properly" by streaming request. So it's still much desirable over my PR. |
let me double check it's entirely possible I fucked up edit: yes I did fucked up testing your branch, it's fast, sorry for that (reason is real results:
|
@tomchristie So, #371 should be closed? |
yup, that said I think @vytas7 is right in saying
so let's close the bug and reopen this once settled ? |
We're back on this! |
Since Starlette has moved to the same middleware proposed here, I think uvicorn should move as well. @abersheeran Do you have time for this PR? If not, I would like to close and make it available for someone else to work on it. 🙏 |
@Kludex Sorry, I recently moved to a new job and don't have time to revise this PR. |
Don't worry. Hope you have a great experience on the new job! 😁 I'll open an issue for this, and see if someone wants to contribute. Thanks! 🙏 |
Related link: #1049 #1235
Perhaps this PR should be merged after several versions of #1235 have been merged to allow enough buffer time for users.
resolved #371 resolved #708