Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src,lib: the handle keeps loop alive in cluster rr mode #46161

Conversation

theanarkh
Copy link
Contributor

@theanarkh theanarkh commented Jan 10, 2023

The handle does not keep loop alive in cluster rr mode, the code is as follows.

const http = require('http');
const cluster = require('cluster');
cluster.schedulingPolicy = cluster.SCHED_RR;

if (cluster.isMaster) {
    cluster.fork();
} else {
    http.createServer((req, res) => {
        res.end('ok');
    }).listen(8888, () => {
        process.channel.unref();
    });
}

So try to fix this issue.

  • 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

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. cluster Issues and PRs related to the cluster subsystem. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Jan 10, 2023
lib/internal/cluster/child.js Outdated Show resolved Hide resolved
src/node_util.cc Outdated Show resolved Hide resolved
@theanarkh theanarkh force-pushed the keep_loop_alive_in_cluster_shared_mode branch 2 times, most recently from 4eeac79 to b93fc9c Compare January 11, 2023 16:09
Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

LGTM (improves on the existing state of things) but see comment.

lib/internal/cluster/child.js Outdated Show resolved Hide resolved
@theanarkh theanarkh force-pushed the keep_loop_alive_in_cluster_shared_mode branch from b93fc9c to 934837c Compare January 12, 2023 00:29
@theanarkh theanarkh force-pushed the keep_loop_alive_in_cluster_shared_mode branch from 934837c to c1486d4 Compare January 12, 2023 16:20
@theanarkh theanarkh force-pushed the keep_loop_alive_in_cluster_shared_mode branch from c1486d4 to 415cbe7 Compare January 12, 2023 16:24
@theanarkh theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 13, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 13, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@theanarkh theanarkh added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 13, 2023
@theanarkh theanarkh added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 16, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 16, 2023
@nodejs-github-bot nodejs-github-bot merged commit 7895484 into nodejs:main Jan 16, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in 7895484

RafaelGSS pushed a commit to RafaelGSS/node that referenced this pull request Jan 17, 2023
PR-URL: nodejs#46161
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Jan 20, 2023
PR-URL: #46161
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Jan 20, 2023
juanarbol pushed a commit that referenced this pull request Jan 26, 2023
PR-URL: #46161
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
@juanarbol juanarbol mentioned this pull request Jan 28, 2023
juanarbol pushed a commit that referenced this pull request Jan 31, 2023
PR-URL: #46161
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
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 pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. cluster Issues and PRs related to the cluster subsystem. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants