Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

response.resume error: Cannot resume() closed Socket. #141

Closed
c4milo opened this Issue · 21 comments

8 participants

@c4milo

Hey,

I'm having this sporadic message, I haven't dig too much into it, but it started to show up once I Implemented a file uploading feature using connect-form.

Any ideas?

@mmalecki

Too little details. What shows this error? node-http-proxy or your app? Where does it come from? Please provide a stack trace (bonus points for example code which causes this).

@c4milo

yeah, sorry I know, it's node-http-proxy that is showing that message. There is not stack trace nor more clues

this is all the code https://gist.github.com/102edfc4136edce001c0

@mmalecki

Sorry, I'm confused. Can you gist node-http-proxy output? If it's an error, there should be a stack trace.

@c4milo

camilo@buggersillo:~/Dropbox/Development/buglabs/bugswarm-http-proxy> sudo node server.js

development: Proxy listening in port 80...
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.
req.resume error: Cannot resume() closed Socket.

that's all what I'm getting

@c4milo

And again, my apologies, It's a sporadic error, I don't have identified the exact steps to reproduce it. What I was doing was uploading binary files with curl to the server, which uses connect-form.

@Marak

Which version of the proxy are you using? Tagged version, or HEAD?

@Marak Marak closed this
@c4milo

tagged 0.7.3

@c4milo

any reason why you closed it? is it an invalid issue, is it valid and you fixed it?

@Marak

Sorry, that was a misclick.

@Marak Marak reopened this
@dominictarr

this is a regression since we went to an implementation based on .pipe

pipe doesn't put a try ... catch around resume, or write, for performance reasons,
Although, they can throw if the socket is closed. the nodejs core team intends to
fix this, to that the http streams etc will not throw in that situation.

what we need to do for now, is monkey patch HttpResponse so that there is a try...catch
and then we can remove that when it's fixed in core.

@dominictarr

also see this discussion:

#115

@dominictarr

@c4milo is this still an issue?

@c4milo

yes

@mmalecki

I can reproduce it on current HEAD by stress testing it with ab.

@c4milo

when are you planing to release a new version?

@dominictarr

this is where that error message comes from:

https://github.com/nodejitsu/node-http-proxy/blob/master/lib/node-http-proxy/http-proxy.js#L242-257

here is my theory: sometimes there is a pause event on the last packet. which soon emits 'drain' on it's own,
however, because, for some reason, node-http-proxy forces 'drain' after 100 milliseconds, some times it emits a drain after the socket is closed.

see this issue: #145

@jesseditson

I'm running into this issue, is there a way to suppress this without modifying the node-http-proxy code?

*edit: I'm running 0.4.11 currently, I'll upgrade soon, but for the time being I'd just like to keep my server logs a little cleaner...

@AvianFlu

Please test this with http-proxy@0.8.0 on node 0.6.x - I believe this was primarily an 0.4.x problem.

@coderarity

@c4milo have you tested this yet (see AvianFlu's comment)? is it still an issue?

@c4milo
@cronopio

@c4milo 0.8.1 is out, please test it for reproduce this issue or close it. Thanks!

@c4milo c4milo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.