I've encountered this problem on node 0.10.43 and using https.
Immediately after timeout event being emited (ECONNRESET), close event is emited as well, so removeSocketfunction is called twice.
For one of them, socket is removed ad destroyed from socket pool, but for another one, socket is not found on sockets pool so it is not removed and destroyed. Regardless socket being present on socket pool, new socket is created unconditionally, which result in:
first call: 1 socket destroyed 1 socket created
second call: 0 socket destroyed 1 socket created
After all, there is +1 socket opened after such events happen, there should be some maxSocket check condition before creating new socket.
I've encountered this problem on node 0.10.43 and using https. Immediately after timeout event being emited (
ECONNRESET
), close event is emited as well, soremoveSocket
function is called twice.For one of them, socket is removed ad destroyed from socket pool, but for another one, socket is not found on sockets pool so it is not removed and destroyed. Regardless socket being present on socket pool, new socket is created unconditionally, which result in:
first call: 1 socket destroyed 1 socket created second call: 0 socket destroyed 1 socket created
After all, there is +1 socket opened after such events happen, there should be some maxSocket check condition before creating new socket.