rackerlabs/developer.rackspace.com — pull request #816 by ycombinator (2014-08-22 20:44:08+00:00)
Title: Close the stream after writing.

Some context for this PR:

We noticed while testing the sponsorship request form that some requests were not being uploaded to Cloud Files. A bit of digging and prototyping later, @smashwilson noticed that Cloud Files was returning a 408 (timeout) response. The logs for the backend process on staging corroborated this. Meanwhile, equivalent curl requests to Cloud Files from the same staging hosts always succeeded. Here is some evidence: https://gist.github.com/ycombinator/8365d0df973bd5805120.

We passed the `X-Trans-Id`s of the curl and node.js requests on to the Cloud Files team, asking them for logs from their servers. They pointed out that the "node.js ones aren't sending data after establishing a connection".

Based on this hypothesis, we tested closing the stream with a `stream.end()` after writing to it. We tested about 20 sponsorship requests with this in place and all of them succeeded.

And that is the genesis of this PR.