worker_threads: proper env and NODE_OPTIONS handling#31711
worker_threads: proper env and NODE_OPTIONS handling#31711lundibundi wants to merge 2 commits intonodejs:masterfrom
Conversation
lib/internal/errors.js
Outdated
There was a problem hiding this comment.
Tbh, I think this is a situation here we should just use ERR_WORKER_INVALID_EXEC_ARGV, as it is the same type of error that’s being reported
There was a problem hiding this comment.
Gave it another thought, imo ERR_WORKER_INVALID_EXEC_ARGV is way too specific and may mislead people into thinking that the error is elsewhere. I think it would be better to add ERR_WORKER_INVALID_OPTIONS and group both ERR_WORKER_INVALID_EXEC_ARGV and ERR_WORKER_INVALID_NODE_OPTIONS under it, though that may be breaking. Or just add and use ERR_WORKER_INVALID_OPTIONS here and then open a semver-major to change that in for ERR_WORKER_INVALID_EXEC_ARGV. wdyt?
There was a problem hiding this comment.
That’s a general problem with our error codes – they tend to be way too specific.
I’d be good with changing the code, but yes, that would be breaking and I’d like to avoid it in this PR.
I’d still be good with using ERR_WORKER_INVALID_EXEC_ARGV and then pointing out in the error message where the error came from (and, ideally, also in a property on the error object). We can always switch that to a different error code later.
(Fwiw, ERR_WORKER_INVALID_OPTIONS sounds like it refers to the options object passed to the Worker constructor…)
There was a problem hiding this comment.
(Fwiw, ERR_WORKER_INVALID_OPTIONS sounds like it refers to the options object passed to the Worker constructor…)
That was the idea - part of the options passed is incorrect. tbh we can probably use ERR_INVALID_OPT_VALUE from #31251 😄.
Then I'll use the ERR_WORKER_INVALID_EXEC_ARGV in this PR and then open another for the error change.
8f49779 to
503003e
Compare
|
Not sure if flaky or a regression: Error Message
fail (6)
Stacktrace
internal/console/global.js:44
globalConsole[kBindStreamsLazy](process);
^
TypeError: globalConsole[kBindStreamsLazy] is not a function
at internal/console/global.js:44:32
at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:276:7)
at nativeModuleRequire (internal/bootstrap/loaders.js:305:14)
at createGlobalConsole (internal/bootstrap/node.js:317:5)
at internal/bootstrap/node.js:120:38Trying a resume for now. |
|
@lundibundi I think I’ve seen that before in another test, but really couldn’t figure out why on earth that would fail … maybe it’s worth opening an issue about that |
|
Landed in 3e9302b...d63bcdd |
PR-URL: #31711 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #31711 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #31711 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #31711 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #31711 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Draft for now, as I still want to review the documentation and take another look at the code.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesCloses: #30627
/cc @nodejs/workers @addaleax