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

zlib: check if the stream is destroyed before push #14330

Closed
wants to merge 1 commit into from

Conversation

mcollina
Copy link
Member

If the stream is destroyed while the transform is still being
applied, push() should not be called, and the internal state
should be cleared.

See: koajs/compress#60

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

zlib, stream

If the stream is destroyed while the transform is still being
applied, push() should not be called, and the internal state
should be cleared.

See: koajs/compress#60
@mcollina mcollina requested a review from mscdex July 17, 2017 17:41
@nodejs-github-bot nodejs-github-bot added the zlib Issues and PRs related to the zlib subsystem. label Jul 17, 2017
@mcollina
Copy link
Member Author

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if the CI comes back OK.

@mcollina mcollina mentioned this pull request Jul 18, 2017
1 task
@mcollina
Copy link
Member Author

@refack
Copy link
Contributor

refack commented Jul 18, 2017

CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/910/ (cc @refack)

Junkins is still in a funky mood, might need to re-run later... nodejs/build#798

@mcollina
Copy link
Member Author

mcollina commented Jul 19, 2017

CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/915/
CITGM (master): https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/916/

cc @refack can you have a look? Or is still problematic?

@mcollina mcollina mentioned this pull request Jul 19, 2017
@mcollina
Copy link
Member Author

Landing, CITGM seems ok.

@mcollina
Copy link
Member Author

Landed as aa496f4.

@mcollina mcollina closed this Jul 19, 2017
@mcollina mcollina deleted the fix-koa-compress branch July 19, 2017 12:13
mcollina added a commit that referenced this pull request Jul 19, 2017
If the stream is destroyed while the transform is still being
applied, push() should not be called, and the internal state
should be cleared.

See: koajs/compress#60
PR-URL: #14330
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@refack
Copy link
Contributor

refack commented Jul 19, 2017

Maybe add koa-compress to CitGM?

@mcollina
Copy link
Member Author

@refack koa-compress tests were passing.

@refack
Copy link
Contributor

refack commented Jul 19, 2017

@refack koa-compress tests were passing.

Will they add a regression test for this?
😕 because GitHub doesn't allow 😞

@mcollina
Copy link
Member Author

I couldn't reproduce this programmatically with koa-compress, but only when load-testing or when my machine was under severe load.

Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request Jul 20, 2017
If the stream is destroyed while the transform is still being
applied, push() should not be called, and the internal state
should be cleared.

Refs: koajs/compress#60
PR-URL: nodejs#14330
Backport-PR-URL: nodejs#14396
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

 Conflicts:
	lib/zlib.js
@MylesBorins
Copy link
Member

@mcollina should this be backported? It would need to be done manually

@mcollina
Copy link
Member Author

This depends on #12925, which is flagged as semver-major. So, no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zlib Issues and PRs related to the zlib subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants