In http.js in the node source, ClientRequest.prototype.onSocket uses 
process.nextTick before setting up the error and close handlers, but it 
seems that a socket can be closed before that callback and the error 
handlers will never be called.  Is this a bug?  Is there something I'm 
missing that would make this code somehow safe?

Why I ask is that under high load, we've had some HTTP requests end up 
never completing, never getting an error, and the OS reports having no open 
sockets.  I added an on('socket') event that asserted that the socket we're 
handed was not already disconnected, and this has started firing, which 
means we're being handed a disconnected socket (and any error or disconnect 
events we set immediately upon creating the request will never get called. 
 This is in the context of a large application with a lot of other stuff 
going on, so it's possible we have a bug elsewhere, but tracing up the 
callstack when we get passed a disconnected socket makes me think this code 
in http.js that may be at fault.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to