-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Stopping/Restarting debugger fails to stop babel-node #57018
Comments
Could you set |
There you go: vscode_debug_log.zip |
@weinand we aren't using I think that instead of this line https://github.com/Microsoft/vscode-node-debug2/blob/master/src/nodeDebugAdapter.ts#L518 we should invoke a version of terminateProcess.sh that sends SIGINT to all child processes. |
@roblourens In the July release we shipped this new feature: By default a SIGINT sent to a process kills the process, which then takes down the child processes as well. If the SIGINT is intercepted by the process (and does not result in a termination of the debuggee), the debug session continues and the red terminate button can be pressed another time. This works as you can see with this snippet const cluster = require('cluster');
const http = require('http');
const numCPUs = require('os').cpus().length / 2;
if (cluster.isMaster) {
console.log(`Master ${process.pid} is running`);
console.log(`Forking ${numCPUs} workers.`);
// Fork workers.
for (let i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on('exit', (worker, code, signal) => {
console.log(`worker ${worker.process.pid} died`);
});
} else {
// Workers can share any TCP connection
// In this case it is an HTTP server
http.createServer((req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);
console.log(`Worker ${process.pid} started`);
} run this with this launch config: {
"type": "node",
"request": "launch",
"name": "Cluster",
"program": "${workspaceFolder}/test.js",
"autoAttachChildProcesses": true
}, and then select the main process in the debug toolbar and terminate it. Observe: all child processes terminate too. @jairelton if you run your |
@weinand When I use |
What I'm seeing is that ctrl+c works, but sending SIGINT doesn't. Also I can send the signal to the process group like So in theory I can change the code in node2 to |
https://nodejs.org/api/child_process.html#child_process_shell_requirements
It works if the process is started with the |
@jairelton if you want a workaround for now, you can set |
Steps to Reproduce:
If the app listen to a port, it will fail to start again with the error: EADDRINUSE
Lauch configuration:
The text was updated successfully, but these errors were encountered: