Commit a7575a36 authored by Eriksson Monteiro's avatar Eriksson Monteiro

kill millix node process when the tangled browsers is stopped

parent 5be0bec4
......@@ -11,6 +11,7 @@
#include <string>
#include <utility>
#include <vector>
#include <signal.h>
#include "base/base_switches.h"
#include "base/bind.h"
......@@ -936,10 +937,10 @@ int BrowserMainLoop::CreateMillixNode() {
".\\nodejs\\node_modules\\@babel\\node\\bin\\babel-node.js");
#else
options.current_directory = dir_exe.AppendASCII("millix_node");
base::CommandLine millix_command_line(
base::FilePath("./nodejs/bin/node"));
base::CommandLine millix_command_line(dir_exe.AppendASCII("millix_node/nodejs/bin/node"));
millix_command_line.AppendArg(
"./nodejs/lib/node_modules/@babel/node/bin/babel-node.js");
options.new_process_group = true;
#endif
millix_command_line.AppendArg("index.js");
// --enable-logging --v=2
......@@ -950,6 +951,7 @@ int BrowserMainLoop::CreateMillixNode() {
LOG(ERROR) << "Unable to run millix node " << millix_command_line.GetCommandLineString().c_str();
return -1;
}
LOG(ERROR) << "millix node process handle" << millix_process_->Handle();
return 0;
}
......@@ -1013,7 +1015,10 @@ void BrowserMainLoop::RunMainMessageLoopParts() {
void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
if (millix_process_->IsValid()) {
millix_process_->Terminate(0, false);
//millix_process_->Terminate(0, false);
auto pgid = -millix_process_->Pid();
LOG(ERROR) << "killing process group id " << pgid;
kill(pgid, SIGTERM);
}
if (!created_threads_) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment