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

Issue 19231006: chrome: respect --child-clean-exit. (Closed)

Created:
7 years, 5 months ago by asharif1
Modified:
7 years, 3 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, bjanakiraman1, scottz, Mattias Nissler (ping if slow), Chris Masone
Visibility:
Public.

Description

chrome: control how chrome orchestrates its exit. Without this CL, the zygote process sends a SIGTERM after 2 seconds of waiting for the renderer process to exit. The renderer process can take longer than 2 seconds if it is instrumented to collect profile data, for example. Another issue with the current exit process is that the browser process can exit before the children exit. This causes issues on ChromeOS where if the browser process exits, the session_manager kills all children of the browser process with a SIGKILL. The goal of this CL is 2-fold: 1. Have --child-clean-exit ensure all child processes exit cleanly. 2. Have --wait-for-children-before-exiting ensure the browser process is the last one to exit. These objectives are achieved through the following measures (when --child-clean-exit and --wait-for-children-to-exit are passed): 1. --child-clean-exit is propagated to the zygote process. 2. The zygote process reaps its child processes instead of sending a SIGTERM to them. 3. The zygote process waits indefinitely until all its child processes have exited. 4. The browser process waits indefinitely until all its child processes have exited. 5. The browser process waits for the zygote and reaps it before exiting. 6. The renderer process does not send a SIGALRM to itself after 30 seconds. Instead it waits indefinitely to cleanly exit. 30 seconds is not enough for a clean exit when Chrome is instrumented and writing profile data. BUG=259824 TEST=python test_clean_exit.py (pyauto unittest already checked in) works.

Patch Set 1 #

Patch Set 2 : Patch is now working. #

Total comments: 4

Patch Set 3 : Made comment better. #

Patch Set 4 : Clarified comment. #

Total comments: 6

Patch Set 5 : Redid the CL a bit. Added a new flag and test. #

Patch Set 6 : Reverted file that was added by mistake. #

Patch Set 7 : Made comments better. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+150 lines, -15 lines) Patch
A chrome/test/functional/test_clean_exit_with_children.py View 1 2 3 4 5 1 chunk +76 lines, -0 lines 0 comments Download
M content/app/content_main_runner.cc View 1 2 3 4 2 chunks +18 lines, -0 lines 0 comments Download
M content/browser/child_process_launcher.cc View 1 2 3 4 5 6 2 chunks +29 lines, -11 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/browser/zygote_host/zygote_host_impl_linux.cc View 1 chunk +1 line, -0 lines 0 comments Download
M content/child/child_thread.cc View 1 2 3 4 1 chunk +5 lines, -1 line 0 comments Download
M content/public/common/content_switches.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/content_switches.cc View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M content/zygote/zygote_linux.cc View 1 2 3 4 4 chunks +17 lines, -2 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
asharif1
Please take a look. I tested it by doing the following: 1. Built Chrome under ...
7 years, 5 months ago (2013-07-18 22:52:55 UTC) #1
jln (very slow on Chromium)
I took a very quick look in a rush, but I thought I would already ...
7 years, 5 months ago (2013-07-18 23:26:05 UTC) #2
Markus (顧孟勤)
https://chromiumcodereview.appspot.com/19231006/diff/3001/content/zygote/zygote_linux.cc File content/zygote/zygote_linux.cc (right): https://chromiumcodereview.appspot.com/19231006/diff/3001/content/zygote/zygote_linux.cc#newcode117 content/zygote/zygote_linux.cc:117: // Wait for all children to exit first. This ...
7 years, 5 months ago (2013-07-18 23:26:47 UTC) #3
asharif1
Please review my comments and take another look at the code. https://codereview.chromium.org/19231006/diff/3001/content/zygote/zygote_linux.cc File content/zygote/zygote_linux.cc (right): ...
7 years, 5 months ago (2013-07-19 03:01:31 UTC) #4
Jói
I'm not an appropriate reviewer for this; removing myself. Perhaps you should ask jam@ to ...
7 years, 5 months ago (2013-07-19 09:14:41 UTC) #5
asharif1
I have updated this patchset. Please take another look.
7 years, 5 months ago (2013-07-19 16:05:23 UTC) #6
asharif1
On 2013/07/19 16:05:23, asharif1 wrote: > I have updated this patchset. Please take another look. ...
7 years, 5 months ago (2013-07-19 16:12:29 UTC) #7
asharif1
Adding mnissler and cmasone to reviewers as they suggested this approach. Adding scottz to cc ...
7 years, 5 months ago (2013-07-19 16:13:27 UTC) #8
jln (very slow on Chromium)
On 2013/07/19 16:13:27, asharif1 wrote: > Adding mnissler and cmasone to reviewers as they suggested ...
7 years, 5 months ago (2013-07-19 16:20:44 UTC) #9
asharif1
On 2013/07/19 16:20:44, Julien Tinnes wrote: > On 2013/07/19 16:13:27, asharif1 wrote: > > Adding ...
7 years, 5 months ago (2013-07-19 16:33:51 UTC) #10
jln (very slow on Chromium)
On 2013/07/19 16:33:51, asharif1 wrote: > On 2013/07/19 16:20:44, Julien Tinnes wrote: > > On ...
7 years, 5 months ago (2013-07-19 16:39:36 UTC) #11
asharif1
jln@, please do a first-pass. Later on I can ask you or markus to do ...
7 years, 5 months ago (2013-07-19 16:54:35 UTC) #12
Markus (顧孟勤)
Other than the fact that this is horribly ugly and complicated code (not your fault!), ...
7 years, 5 months ago (2013-07-22 22:50:13 UTC) #13
asharif1
This CL seems to be working fine for our purposes (profiling an instrumented Chrome) on ...
7 years, 5 months ago (2013-07-22 23:43:54 UTC) #14
Markus (顧孟勤)
https://codereview.chromium.org/19231006/diff/15001/content/browser/child_process_launcher.cc File content/browser/child_process_launcher.cc (right): https://codereview.chromium.org/19231006/diff/15001/content/browser/child_process_launcher.cc#newcode389 content/browser/child_process_launcher.cc:389: base::EnsureProcessGetsReaped(handle); If writing a synchronous version is possible without ...
7 years, 5 months ago (2013-07-22 23:54:27 UTC) #15
asharif1
markus, please take a look again. I have redone this CL a bit. 1. I ...
7 years, 5 months ago (2013-07-24 15:17:23 UTC) #16
jln (very slow on Chromium)
On 2013/07/24 15:17:23, asharif1 wrote: > markus, please take a look again. > > I ...
7 years, 3 months ago (2013-08-27 00:55:13 UTC) #17
asharif1
On 2013/08/27 00:55:13, Julien Tinnes wrote: > On 2013/07/24 15:17:23, asharif1 wrote: > > markus, ...
7 years, 3 months ago (2013-08-27 22:38:03 UTC) #18
jln (very slow on Chromium)
On 2013/08/27 22:38:03, asharif1 wrote: > I can close this CL and someone else can ...
7 years, 3 months ago (2013-08-28 01:28:54 UTC) #19
asharif1
7 years, 3 months ago (2013-09-04 03:08:28 UTC) #20
On 2013/08/28 01:28:54, Julien Tinnes wrote:
> On 2013/08/27 22:38:03, asharif1 wrote:
> 
> > I can close this CL and someone else can own this CL if they want to
implement
> > this solution into Chrome.
> 
> Let me know what you prefer. If you feel like landing it, I'm happy to review!
> Sorry this slipped through.

Closing this now as I have to focus on other things. I'll revive it if I we want
this in.

Powered by Google App Engine
This is Rietveld 408576698