-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Sanic appears to terminate the connection early when downloading on a slow connection #2613
Comments
This seems fixable by setting the value of However, as I understand it, this shouldn't be necessary. My understanding is that, along as the client is still downloading data, |
What you really want is REQUEST_TIMEOUT. https://sanic.dev/en/guide/deployment/configuration.html#request-timeout |
Hi @ahopkins. Thanks for your response. The issue still occurs when setting a very large
And then run this on the command line:
The problem still occurs. |
Here's a pure Python reproduction of the issue (without using curl). As above, run a Sanic server:
And then in a separate process, run this:
In Sanic version 19.12.5 this succeeds, but in Sanic 22.9.1 this fails with this error:
I believe this is because the connection is closed before all of the data is downloaded. |
Is there an existing issue for this?
Describe the bug
When downloading 20MB of data on a slow connection, Sanic appears to terminate the connection early. When running a simple Sanic test server, if I run the following curl command:
I get the following error:
after some time (between 30 seconds and one minute typically).
Code snippet
Run the following Python code:
And then execute this command on the command-line:
Expected Behavior
I would expect the download to complete and all data should be saved to the file at /tmp/output.zip. However, instead I get an error. Full output from curl:
How do you run Sanic?
Script
Operating System
Mac OS 12.2.1 (also appears to happen on Linux in our production system)
Sanic Version
22.9.1 (also tried 21.12.1 and it happens there too)
Additional context
This does not seem to happen in the previous version we used (19.x). I just tried on 19.12.5 and it does not happen.
The text was updated successfully, but these errors were encountered: