Skip to content

Conversation

@addaleax
Copy link
Member

Fix situations in which the handle passed along with a message
that has a large payload and can’t be read entirely by a single
recvmsg() call isn’t associated with the message to which it
belongs.

Fixes: #13778

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

child_process

@nodejs-github-botnodejs-github-bot added the child_process Issues and PRs related to the child_process subsystem. label Aug 2, 2017
Copy link
Member

Choose a reason for hiding this comment

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

Nit: use {payload } for consistency?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@lpinca done!

Copy link
Member

Choose a reason for hiding this comment

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

This looks incorrect: it clears the variable on the first iteration but what if the NODE_HANDLE message is not in the first chunk? I would have expected to see this assignment in the if (message.cmd === 'NODE_HANDLE'){ block.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Right, I think that makes more sense – done.

@addaleaxaddaleaxforce-pushed the cluster-large-message-handle branch 2 times, most recently from 8f3c0e0 to 2f65c3fCompareAugust 2, 2017 09:41
Copy link
Member

@bnoordhuisbnoordhuis left a comment

Choose a reason for hiding this comment

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

LGTM. Maybe add an assert that checks pendingHandle is null again after the loop.

@jasnell
Copy link
Member

Fix situations in which the handle passed along with a message that has a large payload and can’t be read entirely by a single `recvmsg()` call isn’t associated with the message to which it belongs. Fixes: nodejs#13778
@addaleaxaddaleaxforce-pushed the cluster-large-message-handle branch from 2f65c3f to be0fed0CompareAugust 7, 2017 12:05
@addaleax
Copy link
MemberAuthor

So … the test here isn’t even flaky on Windows, it’s just always failing. Would anybody in @nodejs/platform-windows have a chance to look at what’s going wrong?

@addaleax
Copy link
MemberAuthor

Tried something new with help from @tniessen

CI: https://ci.nodejs.org/job/node-test-commit/11599/
Stress: https://ci.nodejs.org/job/node-stress-single-test/1366/

@jasnell
Copy link
Member

Landed in 611851d

@jasnelljasnell closed this Aug 8, 2017
addaleax added a commit that referenced this pull request Aug 9, 2017
Fix situations in which the handle passed along with a message that has a large payload and can’t be read entirely by a single `recvmsg()` call isn’t associated with the message to which it belongs. PR-URL: #14588Fixes: #13778 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
@addaleaxaddaleax deleted the cluster-large-message-handle branch August 10, 2017 19:26
@MylesBorins
Copy link
Contributor

This is going to need a manual backport for both v4 and v6

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

child_processIssues and PRs related to the child_process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@addaleax@jasnell@MylesBorins@bnoordhuis@santigimeno@lpinca@nodejs-github-bot