Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1140)

Unified Diff: mojo/edk/system/node_controller.cc

Issue 2065453004: Always leak the Mojo parent pipe handle on child process shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/node_channel.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/node_controller.cc
diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc
index 9032037e638324b20324ca050769250308677ddb..1fe1865af12591b2f70cf67a06ef37ca4d7e0e52 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -370,6 +370,12 @@ void NodeController::ConnectToParentOnIOThread(
bootstrap_parent_channel_ =
NodeChannel::Create(this, std::move(platform_handle), io_task_runner_,
ProcessErrorCallback());
+ // Prevent the parent pipe handle from being closed on shutdown. Pipe
+ // closure is used by the parent to detect the child process has exited.
+ // Relying on message pipes to be closed is not enough because the parent
+ // may see the message pipe closure before the child is dead, causing the
+ // child process to be unexpectedly SIGKILL'd.
+ bootstrap_parent_channel_->LeakHandleOnShutdown();
}
bootstrap_parent_channel_->Start();
}
« no previous file with comments | « mojo/edk/system/node_channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698