Streams piped into `Bucket.write` aren't paused for unknown lengths
simolus3 opened this issue · 0 comments
simolus3 commented
I'm writing a tool that writes (potentially large) streams from stdin to Cloud Storage. Essentially, the relevant code snippet is stdin.pipe(someBucket.write(somePath)). I do not know the file size beforehand.
In this case, it appears as stdin is first fully read and buffered when writing to the bucket can't keep up. The source of the issue appears to be this:
When we create a new stream controller for resumable uploads, we don't appear to forward pause/resume requests to the original subscription, which causes this problem.
I can open a PR for this, I'm just opening this issue for potential discussion and so that I don't forget :)