joyent/node — Issue #2678: Large file downloads failing in 0.6.9
Author: OrangeDog
Created: 2012-02-02 15:11:18+00:00
State: open

A rather complex server has a request handler that, after various async i/o, offers a large file for download.

var input = fs.createReadableStream(path);
response.pipe(input);

except with error handling etc.

However, on upgrading to Node 0.6.9 from 0.4.11, we noticed that the download is often mysteriously truncated with no errors logged except a Broken Pipe error in an stunnel instance. Investigation reveals that this occurs every time after two minutes when using curl (to Node directly, bypassing stunnel) if the option `--limit-rate 50k` is used. Successful download using Node 0.4.11 takes ~3:30 with the same curl command.

Some details in [this gist](https://gist.github.com/1723858). Note that in the failing case it is Node that sends the first FIN.
Can provide more (e.g. full pcap traces) if required.