Skip to content

fs: fix WriteStream autoClose order - #31790

Closed
ronag wants to merge 1 commit into
nodejs:masterfrom
nxtedition:fs-autoclose-order
Closed

fs: fix WriteStream autoClose order#31790
ronag wants to merge 1 commit into
nodejs:masterfrom
nxtedition:fs-autoclose-order

Conversation

@ronag

Copy link
Copy Markdown
Member

WriteStream autoClose was implemented by manually
calling .destroy() instead of using autoDestroy
and callback. This caused some invariants related
to order of events to be broken.

Fixes: #31776

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

@ronagronag added the stream Issues and PRs related to the stream subsystem. label Feb 14, 2020
@ronag
ronag requested a review from mcollinaFebruary 14, 2020 12:34
@nodejs-github-botnodejs-github-bot added the fs Issues and PRs related to the fs subsystem / file system. label Feb 14, 2020
WriteStream autoClose was implemented by manually
calling .destroy() instead of using autoDestroy
and callback. This caused some invariants related
to order of events to be broken.
Fixes: nodejs#31776

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@ronag
ronag requested a review from addaleaxFebruary 14, 2020 12:55
@ronag

Copy link
Copy Markdown
MemberAuthor

Landed in 568fdfb

@ronagronag closed this Feb 16, 2020
ronag added a commit that referenced this pull request Feb 16, 2020
WriteStream autoClose was implemented by manually
calling .destroy() instead of using autoDestroy
and callback. This caused some invariants related
to order of events to be broken.
Fixes: #31776
PR-URL: #31790
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@ronag

Copy link
Copy Markdown
MemberAuthor

I believe the lts-watch label is appropriate on this PR. Please let me know if incorrect.

@MylesBorins

Copy link
Copy Markdown
Contributor

This doesn't land cleanly on v13.x could it please be backported

@nodejs-github-bot

This comment has been minimized.

ronag added a commit to nxtedition/node that referenced this pull request Mar 10, 2020
WriteStream autoClose was implemented by manually
calling .destroy() instead of using autoDestroy
and callback. This caused some invariants related
to order of events to be broken.
Fixes: nodejs#31776
PR-URL: nodejs#31790
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Backport-PR-URL: nodejs#32163
MylesBorins pushed a commit that referenced this pull request Mar 11, 2020
WriteStream autoClose was implemented by manually
calling .destroy() instead of using autoDestroy
and callback. This caused some invariants related
to order of events to be broken.
Fixes: #31776
Backport-PR-URL: #32163
PR-URL: #31790
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Mar 11, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fsIssues and PRs related to the fs subsystem / file system.streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Writable stream is not immediatly closed after .destroy() call

7 participants

@ronag@nodejs-github-bot@MylesBorins@mcollina@jasnell@lpinca@targos