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

[Cluster] "AssertionError: Resource leak detected" issue from 12.7 still occurs #3149

Closed
Smbc1 opened this issue Oct 1, 2015 · 7 comments
Closed
Labels
cluster Issues and PRs related to the cluster subsystem.

Comments

@Smbc1
Copy link

Smbc1 commented Oct 1, 2015

After moving from node v0.10.38 to v0.12.7 I found an error that occurs sometimes (from 0 to 4-5 in a day) only in production. Process output the same with described in this old topics:
nodejs/node-v0.x-archive#8860
nodejs/node-v0.x-archive#9409

Is it fixed or it's so minor that fix is skipped for a half of year? Is there any workarounds (described in #9404 is not working and just increasing damage by stuck all over the clusterized processes).

@mscdex mscdex added the cluster Issues and PRs related to the cluster subsystem. label Oct 1, 2015
@Smbc1
Copy link
Author

Smbc1 commented Oct 23, 2015

@Smbc1
Copy link
Author

Smbc1 commented Oct 26, 2015

Reproduction of error:

  1. Create run.js:
var cluster = require('cluster');
cluster.schedulingPolicy = 2; // 1 - none (no bug), 2 - round robin (bug)

if (cluster.isMaster){
    const WORKERS_COUNT = 4;
    for (var i = 0; i < WORKERS_COUNT; i++) {
        cluster.fork();
    }
} else {
    var http = require('http'),
        port = process.env.PORT || '3000';

    var srv = http.createServer(function(req, res) {
        if (Math.random() < 0.1) throw new Error('Test error!');
        res.writeHead(200);
        res.write('hello');
        res.end();
    });
    srv.listen(port, function() {
        console.log('Worker is ready');
    });
}
  1. Run: node run.js
  2. Run: ab -n10000 -c100 http://localhost:3000/
    Cannot reproduce bug with NODE_CLUSTER_SCHED_POLICY=none (there is schedulingPolicy = 1), only width NODE_CLUSTER_SCHED_POLICY=rr (schedulingPolicy = 2)

Succesfully reproduced on node 4.1.2 and 0.12.7.

@Smbc1
Copy link
Author

Smbc1 commented Oct 29, 2015

In addition, if use policy = none AND --expose_gc node crushes in C module:
nodejs/node-v0.x-archive#25648 (comment)
@indutny: it's real problem, because it denies using --expose-gc in production with clusterization at all.
Looks similar to #3551

@indutny
Copy link
Member

indutny commented Oct 29, 2015

Relevant: #3551

@bnoordhuis
Copy link
Member

@Unterdrucker Does it happen with master or v5.0.0-rc.2 or v4.2.2-rc.1? A fix was landed recently in da21dba and is about to be released. FWIW, I can't reproduce what you're seeing with master.

@Smbc1
Copy link
Author

Smbc1 commented Oct 30, 2015

@bnoordhuis yes, it's doesn't happen in 5.0.0, thank you, I am going to try it in production.

@cjihrig
Copy link
Contributor

cjihrig commented Nov 13, 2015

Sounds like this has been fixed, so I'm going to close this. Please let me know if it needs to be reopened.

@cjihrig cjihrig closed this as completed Nov 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cluster Issues and PRs related to the cluster subsystem.
Projects
None yet
Development

No branches or pull requests

5 participants