Skip to content

Conversation

@ErickWendel
Copy link
Member

It fixes the problem for child process not receiving messages when forking a process and immediately sending messages on ESM by queuing messages until the process is ready.

Fixes: #41134
Refs: #37782, #39140, #39140, #34785, and help/issues/1383

@nodejs-github-botnodejs-github-bot added child_process Issues and PRs related to the child_process subsystem. needs-ci PRs that need a full CI run. labels Dec 17, 2021
@ErickWendelErickWendelforce-pushed the erickwendel/queue-pending-messages-fork-process branch 2 times, most recently from 3b94fc1 to eb8c12aCompareDecember 17, 2021 15:21
@ErickWendelErickWendelforce-pushed the erickwendel/queue-pending-messages-fork-process branch 3 times, most recently from da5b44c to eef3572CompareDecember 17, 2021 15:50
@ErickWendelErickWendel deleted the erickwendel/queue-pending-messages-fork-process branch December 17, 2021 15:55
@ErickWendelErickWendel restored the erickwendel/queue-pending-messages-fork-process branch December 17, 2021 15:56
Copy link
Member

@edsadredsadr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good but pending from CI, will monitor and remove this once it passes

@ErickWendelErickWendelforce-pushed the erickwendel/queue-pending-messages-fork-process branch from eef3572 to 49abb89CompareDecember 17, 2021 18:20
@aduh95
Copy link
Contributor

Could you add a test please? Let me know if you need help writing one.

@ErickWendel
Copy link
MemberAuthor

ErickWendel commented Dec 17, 2021

Could you add a test please? Let me know if you need help writing one.

There're tests for it before. The problem is that on ESM the behavior is different. As the coverage didn't change I didn't create a test for it. Do you think it's really necessary?

@aduh95
Copy link
Contributor

Yes, we could simply copy the test we have and port it to ESM. It is necessary, otherwise another future change may break it again for ESM and we wouldn't be able to tell.

@ErickWendelErickWendelforce-pushed the erickwendel/queue-pending-messages-fork-process branch from 49abb89 to 0f48517CompareDecember 17, 2021 19:07
@ErickWendel
Copy link
MemberAuthor

Yes, we could simply copy the test we have and port it to ESM. It is necessary, otherwise another future change may break it again for ESM and we wouldn't be able to tell.

Got it! Let me know if this is what you suggested.

@ErickWendelErickWendelforce-pushed the erickwendel/queue-pending-messages-fork-process branch 3 times, most recently from 0168b1b to 100b785CompareDecember 17, 2021 19:11
danielleadams pushed a commit that referenced this pull request Jan 31, 2022
It fixes the problem of the child process not receiving messages. Fixes: #41134 PR-URL: #41221 Reviewed-By: Adrian Estrada <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
Linkgoron pushed a commit to Linkgoron/node that referenced this pull request Jan 31, 2022
It fixes the problem of the child process not receiving messages. Fixes: nodejs#41134 PR-URL: nodejs#41221 Reviewed-By: Adrian Estrada <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
danielleadams pushed a commit that referenced this pull request Feb 1, 2022
It fixes the problem of the child process not receiving messages. Fixes: #41134 PR-URL: #41221 Reviewed-By: Adrian Estrada <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
@danielleadamsdanielleadams mentioned this pull request Feb 1, 2022
mateus-f-torres added a commit to mateus-f-torres/barefoot that referenced this pull request Feb 7, 2022
Needed to resolve issue with Jest process (nodejs/node#41221)
mateus-f-torres added a commit to mateus-f-torres/barefoot that referenced this pull request Feb 9, 2022
Needed to resolve issue with Jest process (nodejs/node#41221)
mateus-f-torres added a commit to mateus-f-torres/barefoot that referenced this pull request Mar 24, 2022
Needed to resolve issue with Jest process (nodejs/node#41221)
mateus-f-torres added a commit to mateus-f-torres/barefoot that referenced this pull request Mar 24, 2022
Needed to resolve issue with Jest process (nodejs/node#41221)
@sublimator
Copy link

Will this be fixed in 14 LTS ?

@aduh95
Copy link
Contributor

v14.x is in maintenance mode, meaning that no change land there unless someone opens a PR to backport it. See https://github.com/nodejs/node/blob/master/doc/contributing/backporting-to-release-lines.md for more info.

@ErickWendel
Copy link
MemberAuthor

@aduh95@sublimator just added a PR for backing porting this feature for 14.x. 🤩

@aduh95aduh95 added backport-open-v14.x and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 23, 2022
@juanarbol
Copy link
Member

Will this be fixed in 14 LTS ?

It will ❤️

juanarbol pushed a commit that referenced this pull request May 1, 2022
It fixes the problem of the child process not receiving messages. Fixes: #41134 PR-URL: #41221 Reviewed-By: Adrian Estrada <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Backport-PR-URL: #42840
@juanarboljuanarbol mentioned this pull request May 1, 2022
tujoworker added a commit to dnbexperience/eufemia that referenced this pull request Jun 13, 2022
This version includes a fix so we can/would run jest with Yarn PnP: nodejs/node#41221
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.child_processIssues and PRs related to the child_process subsystem.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

discussion about how to fix child_process 'spawn' not ready to send messages on ESM

18 participants

@ErickWendel@aduh95@nodejs-github-bot@Trott@Peeja@sublimator@juanarbol@jasnell@addaleax@edsadr@felipe-ssilva@JungMinu@IcaroBichir@brenofsena@joaopcm@ceoofyourmother@danielleadams@DerekNonGeneric