FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lib: fix listen with handle in cluster worker by theanarkh · Pull Request #52056 · nodejs/node · GitHub

/ node Public

lib: fix listen with handle in cluster worker - #52056

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
theanarkh:fix_listen_with_handle
Mar 14, 2024
Merged

lib: fix listen with handle in cluster worker#52056
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
theanarkh:fix_listen_with_handle

Conversation

Copy link
Copy Markdown
Contributor
  1. fork a process by cluster.fork.
  2. call net.createServer().listen(handle) in worker.
  3. the worker will pass some invalid parameters to main process by calling cluster._getServer.
  4. throw an error in main process when try to create a handle or server.

the error is as follows.

TypeError [ERR_INVALID_ARG_VALUE]: The argument 'options' is invalid. Received {
  path: null,
  backlog: 0,
  readableAll: undefined,
  writableAll: undefined
}
    at new NodeError (node:internal/errors:405:5)
    at Server.listen (node:net:2016:9)
    at new RoundRobinHandle (node:internal/cluster/round_robin_handle:36:17)
    at queryServer (node:internal/cluster/primary:298:16)
    at Worker.onmessage (node:internal/cluster/primary:254:5)
    at ChildProcess.onInternalMessage (node:internal/cluster/utils:49:5)
    at ChildProcess.emit (node:events:523:35)
    at emit (node:internal/child_process:944:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21) 

I think it should not call cluster._getServer in this scenario(listen with handle).

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/net

nodejs-github-bot added needs-ci PRs that need a full CI run. net Issues and PRs related to the net subsystem. labels Mar 12, 2024
theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 13, 2024
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 13, 2024

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

mcollina added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. and removed needs-ci PRs that need a full CI run. labels Mar 14, 2024
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 14, 2024
nodejs-github-bot merged commit 20525f1 into nodejs:main Mar 14, 2024

Copy link
Copy Markdown
Collaborator

Landed in 20525f1

marco-ippolito pushed a commit that referenced this pull request May 2, 2024
PR-URL: #52056
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
PR-URL: #52056
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. net Issues and PRs related to the net subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL