Skip to content

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

Closed
ronag wants to merge 1 commit into
nodejs:masterfrom
nxtedition:fs-no-doube-close
Closed

fs: don't double emit close on error#28768
ronag wants to merge 1 commit into
nodejs:masterfrom
nxtedition:fs-no-doube-close

Conversation

@ronag

@ronag ronag commented Jul 19, 2019

Copy link
Copy Markdown
Member

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

ronag commented Jul 19, 2019

Copy link
Copy Markdown
Member Author

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

@ZYSzys ZYSzys 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.

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

@ronag

ronag commented Jul 20, 2019

Copy link
Copy Markdown
Member Author

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

@Trott

Trott commented Jul 22, 2019

Copy link
Copy Markdown
Member

@nodejs/fs

@ronag ronag closed this Aug 8, 2019
@ronag

ronag commented Aug 8, 2019

Copy link
Copy Markdown
Member Author

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