Skip to content

[v13.x backport] zlib: align with streams - #32371

Closed
ronag wants to merge 2 commits into
nodejs:v13.x-stagingfrom
nxtedition:backport-32220-to-v13.x
Closed

[v13.x backport] zlib: align with streams#32371
ronag wants to merge 2 commits into
nodejs:v13.x-stagingfrom
nxtedition:backport-32220-to-v13.x

Conversation

@ronag

Copy link
Copy Markdown
Member

PR-URL: #32220

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added v13.x zlib Issues and PRs related to the zlib subsystem. labels Mar 19, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

- Ensure automatic destruction only happens after both
'end' and 'finish' has been emitted through autoDestroy.
- Ensure close() callback is always invoked.
- Ensure 'error' is only emitted once.
PR-URL: nodejs#32220
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Backport-PR-URL: nodejs#32371
@ronag
ronagforce-pushed the backport-32220-to-v13.x branch from dc563f1 to 76fd0e5CompareMarch 19, 2020 21:15
@MylesBorins

Copy link
Copy Markdown
Contributor

@ronag does #32050 still need to land or should that be marked "do-not-land" now?

@MylesBorins

Copy link
Copy Markdown
Contributor

also there are a ton of failures PTAL

@ronag

Copy link
Copy Markdown
MemberAuthor

@ronag does #32050 still need to land or should that be marked "do-not-land" now?

do not land

@ronag

ronag commented Mar 19, 2020

Copy link
Copy Markdown
MemberAuthor

I think most of the failures is due to the fact we don't emit 'error' twice but I'd like a second opinion. @nodejs/streams. See the fixup commit.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

ts.on('close', common.mustCall(() => {
ts.close(common.mustCall());
}));
ts.on('close', common.mustCall());

@ronagronagMar 19, 2020

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

finished does not invoke callback on closed stream, this was a semver-major fix does not land on 13

name: 'Error',
message: 'Cannot call write after a stream was destroyed'
}
);

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I'm a little unsure how exactly this could throw before.

assert.throws(
() => gunzip.write({}),
TypeError
);

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I'm a little unsure how exactly this could throw before.

@ronag

Copy link
Copy Markdown
MemberAuthor

PR was just labeled as semver-major so I guess this should not be backported.

@ronagronag closed this Mar 23, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

zlibIssues and PRs related to the zlib subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ronag@nodejs-github-bot@MylesBorins