| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Use the default loader as the cascaded loader in the loader worker. Otherwise we spawn loader workers in the loader workers indefinitely.
|
Review requested:
|
Sorry, something went wrong.
There was a problem hiding this comment.
I agree it's a better fix than my PR, I would prefer if we used my test, but other than that LGTM. Thanks!
Sorry, something went wrong.
I’d like to add a few more tests, from the other PR and the simpler cases we discussed that could also trigger the issue, but then this LGTM. |
Sorry, something went wrong.
There was a problem hiding this comment.
This seems a nicely simple fix—thanks for putting it together!
Before landing I would like there to be a few more code comments and, if possible, leverage an existing, persistent fixture (I believe the repro of the issue this addresses does not require dynamically created files, so let's not over-complicate things).
Sorry, something went wrong.
| initializeHooks, | ||
| getDefaultConditions, | ||
| getConditionsSet, | ||
| loaderWorkerId: 'internal/modules/esm/worker', |
There was a problem hiding this comment.
nit: id seems misleading to me, like it's a PID or similar, rather than a path.
| loaderWorkerId: 'internal/modules/esm/worker', | |
| loaderWorkerSpecifier: 'internal/modules/esm/worker', |
Sorry, something went wrong.
There was a problem hiding this comment.
It's definitely not a path (because the internal module loader doesn't use paths), I think calling it an ID is more correct.
Sorry, something went wrong.
There was a problem hiding this comment.
O.o it is literally the path to the file (but with CJS's whacked exclusion of the file extension) and is even consumed as such:
node/lib/internal/modules/esm/hooks.js
Line 498 in 3707d00
Sorry, something went wrong.
There was a problem hiding this comment.
It's not the path to a file, because internal modules are not in the FS, it's more correct to think of them as an offset in the node binary. InternalWorker constructor doesn't take a path, it only accepts internal module IDs – you can try to replace loaderWorkerId with a path at the line you linked to to convince yourself if you want.
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, it’s whatever we call the string that’s the input to internalBinding(). The signature of that function is internalBinding(module), so I guess we could use loaderWorkerModule. Not sure if that’s any better than loaderWorkerId. It’s not really a specifier because we don’t use this with import.
Sorry, something went wrong.
There was a problem hiding this comment.
loaderWorkerModuleId?
Sorry, something went wrong.
| getDefaultConditions, | ||
| getConditionsSet, | ||
| loaderWorkerId: 'internal/modules/esm/worker', | ||
| isLoaderWorker, |
There was a problem hiding this comment.
nit: just make this a getter?
Sorry, something went wrong.
There was a problem hiding this comment.
I would assume a function call would be slower than just mapping directly to a primitive?
Sorry, something went wrong.
Sorry, something went wrong.
|
This isn’t author ready, there are many open questions and requests for more tests. If I have time I’ll add the tests, but this shouldn’t land as is. I think we agree with the general approach and have only nits for the changes themselves, but I at least have objections to the tests. |
Sorry, something went wrong.
|
I suggest we land ASAP (as is) and address the concerns regarding tests and such in a follow up PR, the current flakiness of the CI si very bad for everyone, and there are no blocking comments. |
Sorry, something went wrong.
Sorry, something went wrong.
I’ve added the tests and implemented the code suggestions that had clear resolutions. I left alone possibly renaming loaderWorkerId or changing it to a getter, as we don’t seem to have consensus on those; and those are nits that I think can easily be taken care of in a follow up. I’m okay with landing this now. |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
tests lgtm
Sorry, something went wrong.
Sorry, something went wrong.
Use the default loader as the cascaded loader in the loader worker. Otherwise we spawn loader workers in the loader workers indefinitely. PR-URL: #47620 Fixes: #47566 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Use the default loader as the cascaded loader in the loader worker. Otherwise we spawn loader workers in the loader workers indefinitely. PR-URL: nodejs#47620 Fixes: nodejs#47566 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Use the default loader as the cascaded loader in the loader worker. Otherwise we spawn loader workers in the loader workers indefinitely. PR-URL: #47620 Backport-PR-URL: #50669 Fixes: #47566 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Use the default loader as the cascaded loader in the loader worker. Otherwise we spawn loader workers in the loader workers indefinitely. PR-URL: nodejs/node#47620 Backport-PR-URL: nodejs/node#50669 Fixes: nodejs/node#47566 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Use the default loader as the cascaded loader in the loader worker. Otherwise we spawn loader workers in the loader workers indefinitely. PR-URL: nodejs/node#47620 Backport-PR-URL: nodejs/node#50669 Fixes: nodejs/node#47566 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
| Back | FazBrowse Home | New Git URL |
Use the default loader as the cascaded loader in the loader worker. Otherwise we spawn loader workers in the loader workers indefinitely.
Fixes: #47566