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

Issue 3608015: AU: Catch terminate signals and block exit if necessary. (Closed)

Created:
10 years, 2 months ago by petkov
Modified:
9 years, 7 months ago
Reviewers:
Will Drewry, adlr
CC:
chromium-os-reviews_chromium.org, petkov, adlr
Visibility:
Public.

Description

AU: Catch terminate signals and block exit if necessary. Adds a global Terminator class to manage signals and exit blocking. BUG=7392 TEST=unit tests, gmerged on device, initctl stop update-engine Change-Id: I2291d4eb55240a6662b18ff834af161d957bce2f Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=9c0baf8

Patch Set 1 #

Patch Set 2 : typo #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+98 lines, -4 lines) Patch
M SConstruct View 1 chunk +1 line, -0 lines 0 comments Download
M delta_performer.cc View 4 chunks +7 lines, -2 lines 0 comments Download
M generate_delta_main.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M main.cc View 2 chunks +2 lines, -0 lines 0 comments Download
A terminator.h View 1 1 chunk +45 lines, -0 lines 0 comments Download
A terminator.cc View 1 chunk +36 lines, -0 lines 2 comments Download
M testrunner.cc View 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
petkov
10 years, 2 months ago (2010-10-07 16:46:28 UTC) #1
adlr
LGTM nice! http://codereview.chromium.org/3608015/diff/2001/3005 File terminator.cc (right): http://codereview.chromium.org/3608015/diff/2001/3005#newcode1 terminator.cc:1: // Copyright (c) 2010 The Chromium OS ...
10 years, 2 months ago (2010-10-07 17:26:05 UTC) #2
petkov
10 years, 2 months ago (2010-10-07 17:29:31 UTC) #3
Thanks for the quick review.

http://codereview.chromium.org/3608015/diff/2001/3005
File terminator.cc (right):

http://codereview.chromium.org/3608015/diff/2001/3005#newcode1
terminator.cc:1: // Copyright (c) 2010 The Chromium OS Authors. All rights
reserved.
On 2010/10/07 17:26:05, adlr wrote:
> it might be a bit more efficient to have the OS kill our process if we aren't
> blocking exit, rather than handling the signal and then calling exit. On the
> other hand, by always calling exit(), we are more consistent in how we exit,
> since exit() calls global dtors, atexit() stuff, etc.
> 
> I think the code is fine, just wanted to mention it.

Yeah, thought about this. It seems better to exit cleanly by explicitly calling
exit. We can also exit glib loops, etc. if necessary. Also, we currently catch
only TERM signals. KILL will kill us directly.

I'll leave it as is.

Powered by Google App Engine
This is Rietveld 408576698