Closed fengmk2 closed 10 years ago
agentRemove a free socket... then it wont remove from free sockets queue, then it was reuse, close event was remove, so it will leak on working sockets queue...
Bug is a socket can emit 'agentRemove' event, it should be on working sockets queue.
Another dead lock flow:
httpclient.responseOnEnd()
: response Connection: close
=> socket.destroySoon() https://github.com/joyent/node/blob/master/lib/_http_client.js#L435socket.destroySoon()
: socket waiting finish
event https://github.com/joyent/node/blob/master/lib/net.js#L416FIN
packet and the socket finish event never fire. https://github.com/joyent/node/blob/master/lib/_stream_writable.js#L441The only solution is set a timer on working sockets list.
https://github.com/node-modules/urllib/issues/37
If socket close event not emit, need a way to detect those dead sockets. And close them.