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:
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.
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 thekeepAlive
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
andkeepalive
options but the connection never times out. We also tried todestroy()
the connection but it looks likeconnection.js
is causing the infinite loop.