Skip to content

readStream.end() called asynchronously returns 16 extra rows before stopping #1286

@alexander-fenster

Description

@alexander-fenster

In the current implementation of createReadStream in table.ts, the end user is supposed to stop the streaming synchronously by calling readStream.end(). If they instead call it asynchronously, setTimeout(() => { readStream.end(); }, 0);, a few records (16 to be precise, that's the default value of highWaterMark for object streams) will still be received.

See the skipped test should be able to stop reading from the read stream when reading asynchronously:

it.skip('should be able to stop reading from the read stream when reading asynchronously', function (done) {

Metadata

Metadata

Assignees

Labels

api: bigtableIssues related to the googleapis/nodejs-bigtable API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions