-
Notifications
You must be signed in to change notification settings - Fork 29.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
Redirecting from socket hangs with large data #2323
Comments
I've added some longer tests in LinusU/node-stream-bug which shows that 1) the client request isn't closed 2) the problem exists with |
FWIW the expected output occurs on node v0.10.x |
I think I have a fix for this. PR coming soon ... |
@mscdex Really appreciate the fast response, I'm having limited time and internet connection this weekend but I'll try to review as fast as possible. Thanks for the help! Side note if you happen to know, is cloning your branch and building the only option, or is there some buildbot for pull requests? |
@LinusU AFAIK there is no buildbot for PRs, so you will probably have to just compile manually. |
Built it myself and it fixed the issue 👍 |
When will this PR be merged? Node 0.10.x fails. |
If a pipe is cleaned up (due to unpipe) during a write that returned false, the source stream can get stuck in a paused state. Fixes: nodejs#2323
If a pipe is cleaned up (due to unpipe) during a write that returned false, the source stream can get stuck in a paused state. Fixes: nodejs#2323 PR-URL: nodejs#2325 Reviewed-By: Sakthipriyan Vairamani <[email protected]>
If a pipe is cleaned up (due to unpipe) during a write that returned false, the source stream can get stuck in a paused state. Fixes: #2323 PR-URL: #2325 Reviewed-By: Sakthipriyan Vairamani <[email protected]>
I also posted this to nodejs bug tracker (nodejs/node-v0.x-archive#25823), but the issue is also present in iojs 3.0.0 so it felt appropriate to report it here as well
I've been spending lots of time tracking this down for multer, and form-data/multipart file uploader for express. Basically what we want to do is; whenever there is an error 1)
unpipe
the request 2).resume()
the request so that the browser will consider the request done.This is implemented something like the code below.
req
is an http request from a browser.It has been working great, most of the times. It seems like there is a problem when the stream contains too much data. For some reason it just doesn't emit any more
data
events, and the browser is stuck onuploading (xx%)
.I've managed to track this down and have a small test-case that is easily replicated. The problem goes all the way down to
net.Socket
.Calling
req.resume
aftersocket.pipe(out2)
doesn't help.If the size of each buffer (
560000
) is lowered it starts working. The break point on my machine is at 16 KiB, a.k.a1024 * 16
doesn't work, but1024 * 16 - 1
works.The test case
Actual output
Expected output
The text was updated successfully, but these errors were encountered: