-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Streamed response truncated on Alpine 3.13/3.14 #5902
Comments
I managed to do some additional tests, in order to refine my observations. When files are small enough, there seems to be no issue. But there's one particular large file, which get truncated and I can reproduce it: This file should be:
But it fails on a CancelledError:
|
Might be related to unexpected asyncio.exceptions.CancelledError #5851 |
That issue is only caused by a timeout on client-side code, but I'm under the impression your code is server-side without a timeout (though you have not given enough code for me to tell for sure). But, feel free to test out #5853. Server side cancellations are normally caused by a client disconnecting, so maybe there is a difference in how the client is connecting? If you can post a complete example that reproduces the issue, it would be more helpful for people to take a look. |
I think you're right, but it's not the client of the application: it appears to be the ASGI server itself which breaks the streaming. I am going to close this issue, because it does not apply to aiohttp. The logs were a red herring: it's just aiohttp responding properly to an outside event. Thank you for pointing that out. I've reproduced this issue now on different OS + Python combo's, but it's only the ASGI server which was different: it works with Uvicorn, but it fails with Nginx Unit. |
Describe the bug
The stream from the response is truncated, systematically when running on Alpine 3.13/3.14.
The code is developed on Ubuntu 20.04.1 LTS where this issue does not occur.
The read content lengths do not correspond to the actual file sizes.
To Reproduce
All three strategies fail:
1
2
3
Expected behavior
Reading the response directly does not truncate:
This is the expected behaviour, but this incurs a performance penalty.
Logs/tracebacks
Python Version
aiohttp Version
multidict Version
yarl Version
OS
Alpine 3.13 and Alpine 3.14
Related component
Client
Additional context
await content.read() reads partial content under high load #3881
StreamReader.read truncates content #3926
Code of Conduct
The text was updated successfully, but these errors were encountered: