Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
fs: validate file mode from cpp#52050
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: validate file mode from cpp #52050
Uh oh!
There was an error while loading. Please reload this page.
Conversation
9e327e7 to f88f1f1Compare
H4ad left a comment
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.
Good to have you back! Just leave some non-blocking comments.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot commented Mar 12, 2024
Uh oh!
There was an error while loading. Please reload this page.
RafaelGSS commented Mar 12, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Honestly, I have a feeling this should be considered a This, however, should impact only tests (error conditions). So, if everybody agrees, it shouldn't be that bad to land as a non-semver-major PR (mainly on non-LTS lines). Also, I suspect we are only changing it for performance purposes, right? Would you be able to share benchmarks (preferably in a dedicated machine)? |
anonrig commented Mar 12, 2024
@RafaelGSS I'm -0.5 on making this a semver-major change, because of the past pull-requests. For example, similar PR was landed (#51027) without semver-major. Also, it's extremely easy to make this change since by just moving the order of any validate operation, you can easily break the order. If we follow this path, calling this major change, we should document this before landing this pull-request. But I believe we shouldn't make a claim to preserve the order of errors since it will stall a lot of optimization opportunities by max 1 year (release of major).
@RafaelGSS The original PR has some benchmark results. I don't have access to a dedicated machine to back this claim, but the results from original PR stands: #49970 |
f88f1f1 to 211ad4dComparenodejs-github-bot commented Mar 13, 2024
mcollina left a comment
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.
lgtm
nodejs-github-bot commented Mar 14, 2024
Landed in 3ec20f2 |
PR-URL: nodejs#52050 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #52050 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #52050 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#52050 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This is somewhat similar to #49970, with major modifications to input validation to avoid making this a breaking change due to the input validation on
InfinityandNaNon the original PR. Credit to @andremralves for the initial push.The original PR was blocked due to @tniessen's following comment:
This does not apply because we throw the error synchronously from the C++ side. A similar work was done on
getValidatedFdcouple of months ago. (Ref: #51027)In promisified calls the error was thrown inside an
async function, and it is thrown the similar way. For non promisified calls, right now the error is thrown still synchronously but inside the C++ file before any callback execution is done.The only difference is the order of errors. For example, previously for a callback version of
accesswe were checking the validity ofmodeand later the validity ofcallback, right nowmodeis checked later. According to the documentation, and if I'm not mistaken, this is not a breaking change.cc @nodejs/fs @tniessen @nodejs/performance @nodejs/cpp-reviewers
And most importantly, I'm back.