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 @@ ...@@ -11,6 +11,7 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <signal.h>
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/bind.h" #include "base/bind.h"
...@@ -936,10 +937,10 @@ int BrowserMainLoop::CreateMillixNode() { ...@@ -936,10 +937,10 @@ int BrowserMainLoop::CreateMillixNode() {
".\\nodejs\\node_modules\\@babel\\node\\bin\\babel-node.js"); ".\\nodejs\\node_modules\\@babel\\node\\bin\\babel-node.js");
#else #else
options.current_directory = dir_exe.AppendASCII("millix_node"); options.current_directory = dir_exe.AppendASCII("millix_node");
base::CommandLine millix_command_line( base::CommandLine millix_command_line(dir_exe.AppendASCII("millix_node/nodejs/bin/node"));
base::FilePath("./nodejs/bin/node"));
millix_command_line.AppendArg( millix_command_line.AppendArg(
"./nodejs/lib/node_modules/@babel/node/bin/babel-node.js"); "./nodejs/lib/node_modules/@babel/node/bin/babel-node.js");
options.new_process_group = true;
#endif #endif
millix_command_line.AppendArg("index.js"); millix_command_line.AppendArg("index.js");
// --enable-logging --v=2 // --enable-logging --v=2
...@@ -950,6 +951,7 @@ int BrowserMainLoop::CreateMillixNode() { ...@@ -950,6 +951,7 @@ int BrowserMainLoop::CreateMillixNode() {
LOG(ERROR) << "Unable to run millix node " << millix_command_line.GetCommandLineString().c_str(); LOG(ERROR) << "Unable to run millix node " << millix_command_line.GetCommandLineString().c_str();
return -1; return -1;
} }
LOG(ERROR) << "millix node process handle" << millix_process_->Handle();
return 0; return 0;
} }
...@@ -1013,7 +1015,10 @@ void BrowserMainLoop::RunMainMessageLoopParts() { ...@@ -1013,7 +1015,10 @@ void BrowserMainLoop::RunMainMessageLoopParts() {
void BrowserMainLoop::ShutdownThreadsAndCleanUp() { void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
if (millix_process_->IsValid()) { 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_) { 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