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

fs: don't double emit close on error #28768

Closed
wants to merge 1 commit into from

Conversation

ronag
Copy link
Member

@ronag ronag commented Jul 19, 2019

Readable destroy will emit 'close' on error. No reason to emit it before. Will just cause the error to be emitted twice.

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-bot nodejs-github-bot added the fs Issues and PRs related to the fs subsystem / file system. label Jul 19, 2019
@ronag
Copy link
Member Author

ronag commented Jul 19, 2019

Not sure how to make a test where fs.close fails?

Copy link
Member

@ZYSzys ZYSzys left a comment

Choose a reason for hiding this comment

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

Logically speaking, we need to emit('close') if err and er are both null right ?

@ronag
Copy link
Member Author

ronag commented Jul 20, 2019

@ZYSzys yes? it will be emitted through the callback to destroy.

@Trott
Copy link
Member

Trott commented Jul 22, 2019

@nodejs/fs

@ronag ronag closed this Aug 8, 2019
@ronag
Copy link
Member Author

ronag commented Aug 8, 2019

fixed through #29048

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.

4 participants