Closed broofa closed 3 years ago
After update node version from 8.9.2 to 10.2.0, I also encounter this problem. But don't know why?
@kingeaglewang: Note that this module appears to have been abandoned (3+ years since a new version published, 1+ years since a contributer has commented on an issue).
I've switched to the basic-ftp
module, and have been working with the author on a new release (see the feature/v3
branch).
Edit: Readers may also be interested in @icetee's fork at https://www.npmjs.com/package/@icetee/ftp
I also encounter this problem after upgrade node version to 10.16.5, Is there a bug triggered on 10.x node version ? any suggestion will be appreciated!
I did some investigation. Node.JS v10 changed to use the way for socket clean up at EOF.
Node.JS v8: Find onread()
in https://github.com/nodejs/node/blob/v8.16.2/lib/net.js.
Node.JS v10 Find onStreamRead()
in https://github.com/nodejs/node/blob/v10.17.0/lib/internal/stream_base_commons.js.
I'm not sure about the actual difference yet.
But I noticed in connection.js
, this node-ftp library sends MODE S
when all data is received, switching backing to stream mode. It might be required by compress mode, switching to MODE Z
already, and switching back to MODE S
.
After commenting out the line of self.send('MODE S'...
, keeping _emit('end')
and _emit('close')
, I don't have 2-min hang on Node.JS v10 any more.
function ondone() {
console.log(`${Date.now()} done=${done} lastreply=${lastreply}`);
if (done && lastreply) {
self._send('MODE S', function() {
source._emit('end');
source._emit('close');
}, true);
}
}
@mscdex Time to archive this repo / hand off ownership to someone else? (... conspicuously not volunteering, however. 😝 )
Specifically, when I run the test case below (fetching a single file from a local FTP server), it takes ~53msecs on node v8, but 60000msecs on node 10.
Exact console output listed below as well.
The exact console output, if it helps: