-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Gunicorn 19.4.1 : connection closed too early when serving static file #1155
Comments
@nMustaki also are you giving a content-length to your response? Does it correspond to the file length? |
I didn't check the content-length, the file is served with Flask static system so I figured it should be ok. |
@nMustaki thanks! |
Hi, sorry for the lag... So I reverted the commit ( Thanks again |
Thanks for reporting this. My apologies for the regression. Very much appreciate having this tested live now. I'll see what I can do. @benoitc if you want to revert and make a patch release I can revisit and we can try again with more testing. |
No problem for the regression, you do a really great job so it's fine by me. I added some custom logging, and here what I got :
So the libc.sendfile in _sendfile.py is not sending everything in one shot as expected by the current loop : for m in range(0, nbytes, BLKSIZE):
count = min(nbytes - sent, BLKSIZE)
sent += sendfile(sockno, fileno, offset + sent, count) |
I think this should be fixed now on master. The old code before #1155 did not trust sendfile to send the requested count, but my change left that out. If you get a chance to test, please report back that it is confirmed fixed. |
It's fixed, many thanks ! |
\o/ hurray |
We were bitten by this issue: benoitc/gunicorn#1155
Hi,
first thanks for Gunicorn !
I updated Gunicorn from 19.3.0 to 19.4.1 yesterday evening and serving static js files stopped working because the connection was closed before the file was entirely downloaded. Reverting to 19.3.0, with exactly the same configuration fixed the issue.
The js static file weights 1Mo, but the only the first 5000 lines or so were downloaded.
Some info :
Here are the Gunicorn log file in debug mode
Which were created with this shell call :
Thanks you !
The text was updated successfully, but these errors were encountered: