Uh oh!
There was an error while loading. Please reload this page.
fs: add v8 fast api to closeSync - #53627
Conversation
3d363dc to
734d1baCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
734d1ba to
8354379CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Jul 3, 2024
nodejs-github-bot
commented
Jul 10, 2024
nodejs-github-bot
commented
Jul 11, 2024
There was a problem hiding this comment.
This is unsafe, RemoveUnmanagedFd() can call ProcessEmitWarning() which calls back into JS process.emitWarning() and violates the fast API protocol. Although since it's just a warning, you could probably just add a parameter to RemoveUnmanagedFd to make it invoke ProcessEmitWarning() later in a native Immediate, and scheduling a native immediate is safe.
There was a problem hiding this comment.
If I understood you correctly, inside RemoveUnmanagedFd you want me to conditionally call the following right?
SetImmediateThreadsafe([](Environment* env) {
ProcessEmitWarning(
this, "File descriptor %d closed but not opened in unmanaged mode", fd);
});
If not, what is the correct way to schedule a native immediate?
There was a problem hiding this comment.
I think I got it. Can you review it again? @joyeecheung
8354379 to
7b573d1Comparenodejs-github-bot
commented
Jul 11, 2024
nodejs-github-bot
commented
Jul 11, 2024
anonrig
commented
Jul 12, 2024
cc @nodejs/cpp-reviewers |
| } | ||
| void Environment::RemoveUnmanagedFd(int fd) { | ||
| void Environment::RemoveUnmanagedFd(int fd, bool schedule_native_immediate) { |
There was a problem hiding this comment.
Not: generally not a fan of bool arguments like this. I prefer enums that allow the call sites to be clearer about what the argument is as opposed to just true or false.
nodejs-github-bot
commented
Jul 15, 2024
Landed in ed6f45b |
PR-URL: #53627 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#53627 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Adds V8 Fast API to
fs.closeSync(fd)implementationcc @nodejs/performance @nodejs/fs @nodejs/cpp-reviewers