-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
An error occurred when publishing a static file using uvloop #5149
Comments
Thanks for the very cool reproducible example for the bug! I'm working on an investigation. As a quick workaround you can disable |
Aha, I see the reason. The thing is not as easy as it should be; earlier aiohttp versions used a hack with But the code cannot figure out is the native sendfile supported or not until The solution is dropping custom
Ironically, uvloop uses the slow fallback until it supports the native This is the plan. Implementation can take a day or two -- depending on my daily job. If somebody wants to pick the issue up and prepare a fix himself -- you are welcome. |
Hey! I've created a PR with fixes, following your plan. I hope I got it right :) |
This fixes an upstream issue (aio-libs/aiohttp#5149).
* This fixes an upstream issue (aio-libs/aiohttp#5149) related to `sendfile()` fallback with uvloop.
* This fixes an upstream issue (aio-libs/aiohttp#5149) related to `sendfile()` fallback with uvloop.
* This fixes an upstream issue (aio-libs/aiohttp#5149) related to `sendfile()` fallback with uvloop. Backported-From: master Backported-To: 20.03
🐞 Describe the bug
An error occurred when publishing a static file using aiohttp 3.7.x and uvloop.
💡 To Reproduce
Then, build and run server.
Finally, try to access http://localhost:8080/static/index.css .
When accessed from a browser, the following error is displayed in the developer console.
When accessed from a cURL, the following error is displayed.
It looks like the connection was closed before sending the response body.
💡 Expected behavior
No error occurs.
📋 Logs/tracebacks
No messages are displayed in the Python log at all.
📋 Your version of the Python
📋 Your version of the aiohttp/yarl/multidict distributions
📋 Additional context
The text was updated successfully, but these errors were encountered: