-
Notifications
You must be signed in to change notification settings - Fork 30k
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
FATAL ERROR if filehandle.close() is called after fd is closed by createReadStream #31202
Labels
fs
Issues and PRs related to the fs subsystem / file system.
Comments
looks like non-promisified variant works as expected: const fs = require('fs')
const file = './test.txt'
fs.open(file, (err, fd) => {
const str = fs.createReadStream(file, {fd: fd})
str.on('end', () => {
fs.close(fd, (err) => {console.log(err)})
})
str.pipe(process.stdout)
})
|
addaleax
added a commit
to addaleax/node
that referenced
this issue
Jan 9, 2020
3 tasks
MylesBorins
pushed a commit
that referenced
this issue
Jan 16, 2020
Fixes: #31202 PR-URL: #31276 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
codebytere
pushed a commit
that referenced
this issue
Mar 14, 2020
Fixes: #31202 PR-URL: #31276 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
codebytere
pushed a commit
that referenced
this issue
Mar 17, 2020
Fixes: #31202 PR-URL: #31276 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Node will abort if filehandle.close() is called after fd is closed by createReadStream.
I am unsure if this "FATAL ERROR" is considered a bug or is expected behavior.
I expected a javascript rejection from fh.close().
stacktrace:
The text was updated successfully, but these errors were encountered: