Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reduce through2 usage #711

Merged
merged 1 commit into from Apr 17, 2020
Merged

fix: reduce through2 usage #711

merged 1 commit into from Apr 17, 2020

Conversation

JustinBeckwith
Copy link
Contributor

@JustinBeckwith JustinBeckwith commented Apr 17, 2020

This is the part where I admit to not understanding how the other stream fix y'all landed works, or if this would be subject to the same kind of problem. I do know that the last 2 usages of through2 in the codebase cause sample test failures if you swap them out with PassThrough. Can I ask you both to poke holes in this?

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 17, 2020
@codecov
Copy link

codecov bot commented Apr 17, 2020

Codecov Report

Merging #711 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #711      +/-   ##
==========================================
- Coverage   98.99%   98.99%   -0.01%     
==========================================
  Files          15       15              
  Lines       15311    15310       -1     
  Branches      932      932              
==========================================
- Hits        15157    15156       -1     
  Misses        151      151              
  Partials        3        3              
Impacted Files Coverage Δ
src/index.ts 99.82% <100.00%> (-0.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4125e06...bc10aff. Read the comment docs.

@crwilcox
Copy link
Contributor

crwilcox commented Apr 17, 2020

The default through.objseems equivalent to pass through. The other usages are nested streams to allow for retry. The other fix was due to one stream ending, but not unpiping causing write after end errors.
https://github.com/googleapis/nodejs-bigtable/blob/master/src/table.ts#L689

I think the instances in table.ts need to replace the usage with

stream.Transform(writableObjectMode: true, transform: (chunk, encoding, callback) => {
  // bespoke transform
});

@JustinBeckwith JustinBeckwith merged commit dd84765 into master Apr 17, 2020
@stephenplusplus stephenplusplus deleted the nothru2 branch August 10, 2020 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants