FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fs: replace `SetMethodNoSideEffect` in `node_file.cc` by CanadaHonk · Pull Request #49857 · nodejs/node · GitHub

/ node Public

fs: replace SetMethodNoSideEffect in node_file.cc - #49857

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
CanadaHonk:fs-replace-nosideeffect
Sep 27, 2023
Merged

fs: replace SetMethodNoSideEffect in node_file.cc#49857
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
CanadaHonk:fs-replace-nosideeffect

Conversation

Copy link
Copy Markdown
Member

All FS methods should not use it since FS operations will have side effects (suggested by @anonrig)

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Sep 25, 2023

anonrig commented Sep 25, 2023

Copy link
Copy Markdown
Member

cc @joyeecheung

anonrig added fast-track PRs that do not need to wait for 48 hours to land. author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Sep 25, 2023

This comment was marked as outdated.

github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 25, 2023

Copy link
Copy Markdown
Collaborator

CanadaHonk force-pushed the fs-replace-nosideeffect branch from 2cf762e to bf379ef Compare September 25, 2023 13:19

Copy link
Copy Markdown
Member

Why is this being fast tracked does it unblock something?

Copy link
Copy Markdown
Member Author

Why is this being fast tracked does it unblock something?

Pretty sure it's because it fixes repl possibly doing unwanted real FS ops for a few functions if you were to type out but not press enter (eg fs.copyFileSync(...)).

anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 25, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 25, 2023

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

cjihrig commented Sep 25, 2023

Copy link
Copy Markdown
Contributor

The fact that this fixes a bug does not really mean that it qualifies for fast tracking.

cjihrig removed the fast-track PRs that do not need to wait for 48 hours to land. label Sep 25, 2023

targos commented Sep 25, 2023
edited
Loading

Copy link
Copy Markdown
Member
  • The side-effect of copyFileSync is obvious.
  • I guess that readFileUtf8 can modify the atime of the file
  • But what are the observable side-effects of accessSync and existsSync ?

anonrig commented Sep 25, 2023

Copy link
Copy Markdown
Member

But what are the observable side-effects of accessSync and existsSync ?

There isn't but referring to @joyeecheung's message (ref: #49748 (comment)), I think it is unnecessary to run fs operations (since they're costly) on REPL.

anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 25, 2023

cjihrig commented Sep 26, 2023

Copy link
Copy Markdown
Contributor

but referring to @joyeecheung's message

I don't interpret @joyeecheung's comment (but please correct me if I'm wrong) to mean we shouldn't do it because of performance reasons. I interpret it as chown() having very real side effects.

I think it is unnecessary to run fs operations (since they're costly) on REPL.

I don't feel strongly about this, but I think this is another case where performance just isn't important. The REPL is meant to be interactive and a person typing fs.accessSync() or fs.existsSync() is very unlikely to notice any difference in performance.

nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 27, 2023
nodejs-github-bot merged commit 783f64b into nodejs:main Sep 27, 2023

Copy link
Copy Markdown
Collaborator

Landed in 783f64b

ruyadorno pushed a commit that referenced this pull request Sep 28, 2023
PR-URL: #49857
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
ruyadorno mentioned this pull request Sep 28, 2023
ruyadorno pushed a commit that referenced this pull request Sep 28, 2023
PR-URL: #49857
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
ruyadorno mentioned this pull request Sep 28, 2023
debadree25 pushed a commit to debadree25/node that referenced this pull request Apr 15, 2024
PR-URL: nodejs#49857
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL