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

Issue 14759006: Kill subprocesses on KeyboardInterrupt. (Closed)

Created:
7 years, 7 months ago by Mike Stip (use stip instead)
Modified:
7 years, 7 months ago
CC:
chromium-reviews, Dirk Pranke, cmp-cc_chromium.org, M-A Ruel, iannucci+depot_tools_chromium.org, iannucci, Isaac (away)
Base URL:
https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Visibility:
Public.

Description

Kill subprocesses on KeyboardInterrupt. SVN traps SIGINT and attempts to clean itself up, but this results in hangs waiting for TCP. This patch does two things: daemonizes worker threads so they are culled when the main thread dies (is ctrl-C'd) and keeps track of spawned subprocesses to kill any remaining ones when the main program is ctrl-C'd. A user ctrl-C'ing gclient has to manually terminate hung SVN processes, so this introduces no extra data loss or hazard. stracing a hung SVN process shows that it is indeed hanging on TCP reads after receiving a SIGINT, implying there is an underlying but in the SVN binary. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=198205

Patch Set 1 #

Total comments: 3

Patch Set 2 : Address comments, handle process aliveness better. #

Patch Set 3 : Spacing. #

Total comments: 4

Patch Set 4 : Don't kill with lock, address more comments. #

Patch Set 5 : Don't pop from a list as it's being iterated. #

Total comments: 6

Patch Set 6 : Fix nit. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -7 lines) Patch
M gclient.py View 1 1 chunk +3 lines, -0 lines 0 comments Download
M gclient_utils.py View 1 2 3 4 5 5 chunks +69 lines, -6 lines 0 comments Download
M tests/gclient_utils_test.py View 1 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 12 (0 generated)
Mike Stip (use stip instead)
ptal
7 years, 7 months ago (2013-05-03 15:40:45 UTC) #1
M-A Ruel
https://codereview.chromium.org/14759006/diff/1/gclient.py File gclient.py (right): https://codereview.chromium.org/14759006/diff/1/gclient.py#newcode1789 gclient.py:1789: except KeyboardInterrupt: Why not inside Main()? https://codereview.chromium.org/14759006/diff/1/gclient_utils.py File gclient_utils.py ...
7 years, 7 months ago (2013-05-03 16:39:01 UTC) #2
Mike Stip (use stip instead)
Addressed the comments. ptal!
7 years, 7 months ago (2013-05-03 17:30:39 UTC) #3
M-A Ruel
https://chromiumcodereview.appspot.com/14759006/diff/10001/gclient_utils.py File gclient_utils.py (right): https://chromiumcodereview.appspot.com/14759006/diff/10001/gclient_utils.py#newcode326 gclient_utils.py:326: GCLIENT_CHILDREN = {} Why a dict instead of a ...
7 years, 7 months ago (2013-05-03 20:54:12 UTC) #4
Dirk Pranke
It will be great to fix this, but something tells me that kill() isn't reliable ...
7 years, 7 months ago (2013-05-03 21:04:13 UTC) #5
Mike Stip (use stip instead)
On 2013/05/03 21:04:13, Dirk Pranke wrote: > It will be great to fix this, but ...
7 years, 7 months ago (2013-05-03 21:14:16 UTC) #6
Mike Stip (use stip instead)
Addressed comments. ptal! https://chromiumcodereview.appspot.com/14759006/diff/10001/gclient_utils.py File gclient_utils.py (right): https://chromiumcodereview.appspot.com/14759006/diff/10001/gclient_utils.py#newcode326 gclient_utils.py:326: GCLIENT_CHILDREN = {} On 2013/05/03 20:54:12, ...
7 years, 7 months ago (2013-05-03 21:16:08 UTC) #7
M-A Ruel
lgtm, I agree list.remove() could become a bottleneck, so I'm fine with a dict. https://chromiumcodereview.appspot.com/14759006/diff/19001/gclient_utils.py ...
7 years, 7 months ago (2013-05-03 21:26:42 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/xusydoc@chromium.org/14759006/24001
7 years, 7 months ago (2013-05-03 21:55:57 UTC) #9
commit-bot: I haz the power
Change committed as 198205
7 years, 7 months ago (2013-05-03 21:57:56 UTC) #10
Isaac (away)
Some comments inline. I'm a confused by the use of ready_cond in the existing code. ...
7 years, 7 months ago (2013-05-03 22:00:38 UTC) #11
Isaac (away)
7 years, 7 months ago (2013-05-03 22:02:08 UTC) #12
Message was sent while issue was closed.
Looks like I sent this too late -- could you please create follow up patch
addressing comments?  Thanks.

Powered by Google App Engine
This is Rietveld 408576698