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

朴灵老师,多进程中,如果创建子进程之后server.close(),就不能再次fork进程了 #13

Open
clancytom opened this issue Jan 5, 2018 · 3 comments

Comments

@clancytom
Copy link

for (var i = 0; i < cpus.length; i++) {
  createWorker();
}
server.close();
var server = http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('handled by child, pid is ' + process.pid + '\n');
  throw new Error('throw exception');
});
TypeError: Cannot read property '_simultaneousAccepts' of null
    at Object._setSimultaneousAccepts (net.js:1706:16)
    at ChildProcess.target._send (internal/child_process.js:657:13)
    at ChildProcess.target.send (internal/child_process.js:586:19)
    at Master.forkWorker (G:\code\config-app-soa-master\config-app\ds-uibuilder\dist\src\server\cluster\master.js:60:16)
    at ChildProcess.worker.on (G:\code\config-app-soa-master\config-app\ds-uibuilder\dist\src\server\cluster\master.js:71:18)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
@clancytom
Copy link
Author

子进程挂掉之后,父进程的监听已经关闭了,此时如何才能重新fork进程了

@clancytom clancytom changed the title 第9章第2节,如果创建子进程之后server.close(),就不能再次fork进程了 朴灵老师,多进程中,如果创建子进程之后server.close(),就不能再次fork进程了 Jan 5, 2018
@JacksonTian
Copy link
Owner

什么版本。

@clancytom
Copy link
Author

G:\code\config-app-soa-master\config-app\ds-uibuilder>node -v
v8.9.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants