molnarg / node-http2

An HTTP/2 client and server implementation for node.js
MIT License
1.79k stars 185 forks source link

ECONNRESET not handled #194

Open mihai1voicescu opened 8 years ago

mihai1voicescu commented 8 years ago

There was an issue in Node.js regarding keepAlive connections when the ECONNRESET occurred. This was fixed (https://github.com/nodejs/node/issues/3595) but it involved adding a new 'error' listener on a free socket. The problem is you remove this protection after the protocol negotiation: https://github.com/molnarg/node-http2/blob/master/lib/http.js#L969

Normally another protection is added when the stream ends by Node.js (https://github.com/nodejs/node/blob/master/lib/_http_client.js#L500), but this event does not occur. Maybe because the stream in the http2 connection never ends (not sure about this maybe you can clear this up).

And by the way @felicienfrancois resolved some pretty important issues regarding the client side and Agent option. You should really consider integrating his pull requests.

clarencetw commented 8 years ago

I also encountered the same problem