node-ftp icon indicating copy to clipboard operation
node-ftp copied to clipboard

Interrupted Stream does not timeout FTP connection, it hangs script

Open laughland opened this issue 7 years ago • 3 comments

We are using node-ftp to get files from our ftp server. Sometimes the network connection is reset and we lose the data stream before it completes. This hangs our script and it never times out - we have to kill the script manually.

I ran the code through a debugger and the following code in connection.js just seems to loop indefinitely; t the keepAlive is just getting reset and running over and over. Here is the code I am referring to:

https://github.com/mscdex/node-ftp/blob/7dff82fc049a52f51803bdffb95ec1de383f9fac/lib/connection.js#L151

We tried using the connTimeout and keepalive options but the connection never times out. We also tried to destroy() the connection but it looks like connection.js is causing the infinite loop.

laughland avatar Feb 09 '18 20:02 laughland

+1

slavik57 avatar Jun 28 '18 08:06 slavik57

+1

greflm13 avatar Oct 30 '18 16:10 greflm13

+1

yankarlo-test avatar Jan 25 '19 19:01 yankarlo-test