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

[v13.x backport] fs: fix WriteStream autoClose order #32163

Closed

Conversation

ronag
Copy link
Member

@ronag ronag commented Mar 9, 2020

PR-URL: #31790

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

@ronag ronag added the fs Issues and PRs related to the fs subsystem / file system. label Mar 9, 2020
@ronag ronag requested a review from MylesBorins March 9, 2020 22:23
@nodejs-github-bot
Copy link
Collaborator

@MylesBorins
Copy link
Member

hey @ronag thanks for putting this together. I noticed that you modified the original meta data of the commit in this PR to include the backport PR URL and removed the original sign offs. For backport PRs it would be best if you could leave all the original commit meta data in place. Our tooling relies on that information for generating changelogs and it is a little more work for us to dig up the original meta data vs simply adding the Backport-PR-URL when ladning. FWIW don't worry about it for this PR (or the others you just opened) I'll fix that when landing, it is easy enough.

Very much appreciate the initiative here though!

);
file.write('should not work anymore', common.mustCall((err) => {
assert.strictEqual(err.code, 'ERR_STREAM_WRITE_AFTER_END');
}));
Copy link
Member Author

@ronag ronag Mar 10, 2020

Choose a reason for hiding this comment

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

This needs to be updated since the timing changes, which is the purpose of the original fix.

@nodejs-github-bot
Copy link
Collaborator

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
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@mcollina mcollina left a comment

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
Collaborator

nodejs-github-bot commented Mar 10, 2020

@MylesBorins
Copy link
Member

Looks like OSX failures are consistent (compare the CI & retry OSX runs in above comment)

Here's a run against the current v13.x-staging branch as comparison

https://ci.nodejs.org/job/node-test-commit-osx/32533/

@ronag
Copy link
Member Author

ronag commented Mar 10, 2020

@MylesBorins The failing tests seem totally unrelated though?

Waiting for the referenced CI run to complete for comparison.

@ronag
Copy link
Member Author

ronag commented Mar 10, 2020

So test.sequential/test-timers-blocking-callback seems to be the difference, but again I can't see any relation to this PR. I'll run just one more CI to be sure.

@MylesBorins
Copy link
Member

@ronag dgram uses streams doesn't it? maybe try rebasing against staging and running tests again?

@ronag
Copy link
Member Author

ronag commented Mar 10, 2020

@ronag
Copy link
Member Author

ronag commented Mar 10, 2020

dgram uses streams doesn't it?

This PR only affects fs.

@MylesBorins
Copy link
Member

Then it might be flakes that are now properly marked. Could you try rebasing and running CI one more time?

@ronag
Copy link
Member Author

ronag commented Mar 10, 2020

Then it might be flakes that are now properly marked. Could you try rebasing and running CI one more time?

Yep, already done, see CI link above.

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>
@MylesBorins
Copy link
Member

Fails are definitely unrelated the majority are already marked flaky but one isn't. Opened a PR to mark flaky

Landed in 7eed9d6

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

Successfully merging this pull request may close these issues.

None yet

4 participants