GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — doc: warn against awaiting replies in module hooks by bitpshr · Pull Request #65590 · nodejs/node Conversation
Contributor
Fixes: #63085
This adds a short paragraph after the messaging example saying so. The issue reporter hit this and it is not obvious from the surrounding text, which reads as though the channel is bidirectional in the usual way.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is not true:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JakobJingleheimer I think we are talking about two different things. I checked return transform(rawSource, { sourcefile: url, ...esbuildConfig }) .catch((f) => handleTrasformErrors(f, url)) .then(({ code: source, warnings }) => { What deadlocks is narrower: awaiting a reply from the thread that registered the hook, over the message channel from the preceding example. That thread is blocked inside the resolution or load it triggered, so it cannot run a listener to answer, and both sides wait forever. That is what the reporter hit in #63085. So hooks can absolutely be async. The only thing that cannot be awaited is a response from the registering thread. My sentence did not make that scope clear, so how about:
Happy to push that, or to drop it entirely if you think the distinction is too narrow to be worth documenting.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh. Yes, much cleaner 🙂 thanks!
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
JakobJingleheimer
approved these changes
jsumners-nr
approved these changes
Awaiting a reply from the registering thread inside a resolve or load hook deadlocks: resolution is synchronous from that thread's perspective, so it is blocked in the request and cannot answer. Fixes: nodejs#63085 Signed-off-by: Paul Bouchon <[email protected]>
bitpshr
force-pushed
the
doc/hooks-no-main-thread-await
branch
from
eba7b53 to
05c5619
Compare
|
There was an error while loading. Please reload this page.
|
Hi @JakobJingleheimer @jsumners-nr, I pushed the verbiage change mentioned here, which cleared approvals. Mind reviewing this one again? Thanks in advance. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Landed in c0c8ce8 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Awaiting a reply from the registering thread inside a resolve or load hook deadlocks: resolution is synchronous from that thread's perspective, so it is blocked in the request and cannot answer. Fixes: #63085 Signed-off-by: Paul Bouchon <[email protected]> PR-URL: #65590 Reviewed-By: Jacob Smith <[email protected]>
Awaiting a reply from the registering thread inside a resolve or load hook deadlocks: resolution is synchronous from that thread's perspective, so it is blocked in the request and cannot answer. Fixes: nodejs#63085 Signed-off-by: Paul Bouchon <[email protected]> PR-URL: nodejs#65590 Reviewed-By: Jacob Smith <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Loader stalls MessagePort since v24
There was an error while loading. Please reload this page.