danwrong / restler

REST client library for node.js
MIT License
1.99k stars 391 forks source link

stream.js, ECONNRESET #126

Open andrewspode opened 11 years ago

andrewspode commented 11 years ago

I'm trying to send files as a multi-part form and it's working fine. However, sporadically, it's giving me this error:

"stream.js:94 throw er; // Unhandled stream error in pipe. ^ Error: read ECONNRESET at errnoException (net.js:901:11) at TCP.onread (net.js:556:19) "

If I'm not mistaken, this should be taken care of by this library?

easternbloc commented 10 years ago

I can't reproduce this.

If you can give me a reproducible test case I will reopen.

andrewspode commented 10 years ago

I'm not sure I can do that - I occasionally get the same error for a "SOCKET HUNG UP" (or similar).

couchDB I think is getting overloaded and terminating the connection. But in either case - the error handling doesn't seem to be there for these rare cases.

So it doesn't need to be reproducible - we just need a catch all for errors not being caught to simply fail rather than kill the whole script?

easternbloc commented 10 years ago

I'll take a look

andrewspode commented 10 years ago

Thanks - I can probably take a look as well tomorrow if you don't get anywhere. (spode@justfdi.com if you want to get hold of me).

My scenario is I have a daemon running - opening and closing a lot of connections. All it takes is one of those to be disconnected at the other end for the example, and then the daemon shuts down. I can use Forever - but that's a band aid for the problem.