-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Revert "fs: ensure readFile[Sync] reads from the beginning" #10809
Conversation
This reverts commit 4444e73.
Which tests fail for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can reproduce these failures on master
on Linux
LGTM
I’m landing this to un-break master… it’s just a revert so we shouldn’t need to wait for CI @seishun The PR description was edited here to include the relevant output of |
Landed in 66f09be |
Ok, I see why it fails. The tests call
cc @nodejs/platform-macos @nodejs/collaborators |
There might be a reasonable interpretation what that means then talking about stdin; namely, open the file and read until EOF is hit. What pretty much doesn’t make sense here is reading from a given offset. (This isn’t MacOS-specific, by the way; it should affect all POSIX systems, at least.) |
Right, in that case it would have to use the old behavior for all TTYs, pipes and sockets.
Right, if you're using |
We could probably reasonably do special-casing based on whether the fd refers to a regular file or not, yeah.
Okay, this is obviously just my personal impression, but I wouldn’t actually expect that to happen? Maybe it’s just me, but I’d definitely find it weird for the same data to be read twice from an fd. |
Are you talking about "non-regular" fds or all fds? In the latter case, the current behavior is what you want, and I'd be fine with it, but the docs need to be clarified then. |
Should we add an item to the PR template checklist about running CI for the last commit before the PR lands? (and other things like number of LGTMs, 48-hour wait, .etc) |
@joyeecheung: That likely wouldn't help much. It's just something that those of us landing PRs need to remember to check for. Thank you @addaleax for landing the revert. |
I definitely can see arguments for both perspective, but yeah, what I had in mind was having the current behaviour for all file types. |
This reverts commit 4444e73. PR-URL: nodejs#10809 Reviewed-By: Anna Henningsen <anna@addaleax.net>
This reverts commit 4444e73.
Looks like #9699 was landed without a CI Run. It breaks three tests in my
Mac OS.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
fs
cc @seishun