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

Issue 2880333004: Fix not deleting a lockfile or not killing a frozen browser on hostname change (Closed)

Created:
3 years, 7 months ago by Alexey Seren
Modified:
3 years, 6 months ago
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix process_singleton_posix handling of hostname changes not deleting a stale lockfile or not killing a frozen browser. First issue: 1. Chrome is run. 2. Hostname is changed. 3. Chrome crashes, leaving the lock file with the old hostname. 4. A different chrome runs with a different user-data-dir and just happens to get the same pid as from step #1. 5. Chrome is run again with the original user-data-dir. It sees there is a lock file with a different hostname, but sees that there is a chrome process with the same pid, so it can reach the KillProcessByLockPath in the connect retry loop. In this case, lockfile is not deleted. We need to delete lock file without killing anything. Second issue: 1. Chrome is run. 2. Hostname is changed. 3. Chrome freezes, it's still listening on the socket with the old hostname, but not responding to any messages. 4. Chrome is run again. It can connect to the socket, but times out waiting for a response, hitting one of read timeout or write timeout KillProcessByLockPath calls. In this case, we'd actually want to kill the frozen chrome in addition to deleting the lockfile, which the code currently doesn't do. CL fixes both of these issues. R=jochen@chromium.org, mattm@chromium.org BUG=722749 Review-Url: https://codereview.chromium.org/2880333004 Cr-Commit-Position: refs/heads/master@{#477342} Committed: https://chromium.googlesource.com/chromium/src/+/67095448eb212b9f8e09f071515669d9618e7534

Patch Set 1 #

Patch Set 2 : Added appropriate histograms check + rebase #

Patch Set 3 : Fix issue with hung browser after hostname change #

Total comments: 4

Patch Set 4 : Renamed KillProcessByLockPath() parameter to is_connected_to_socket #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -20 lines) Patch
M chrome/browser/process_singleton.h View 1 2 3 2 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/process_singleton_posix.cc View 1 2 3 8 chunks +24 lines, -10 lines 0 comments Download
M chrome/browser/process_singleton_posix_unittest.cc View 1 2 4 chunks +64 lines, -7 lines 0 comments Download

Messages

Total messages: 43 (21 generated)
Alexey Seren
3 years, 7 months ago (2017-05-16 08:56:36 UTC) #1
jochen (gone - plz use gerrit)
will stamp once the CL looks good to gab@
3 years, 7 months ago (2017-05-16 11:17:14 UTC) #2
gab
On 2017/05/16 11:17:14, jochen wrote: > will stamp once the CL looks good to gab@ ...
3 years, 7 months ago (2017-05-16 15:10:18 UTC) #3
Alexey Seren
PTAL
3 years, 7 months ago (2017-05-17 20:03:08 UTC) #7
mattm
On 2017/05/17 20:03:08, Alexey Seren wrote: > PTAL Is this a theoretical fix, or are ...
3 years, 7 months ago (2017-05-18 02:26:07 UTC) #8
Alexey Seren
On 2017/05/18 02:26:07, mattm wrote: > On 2017/05/17 20:03:08, Alexey Seren wrote: > > PTAL ...
3 years, 7 months ago (2017-05-18 18:58:40 UTC) #9
mattm
On 2017/05/18 18:58:40, Alexey Seren wrote: > On 2017/05/18 02:26:07, mattm wrote: > > On ...
3 years, 7 months ago (2017-05-23 17:15:48 UTC) #10
Alexey Seren
On 2017/05/23 17:15:48, mattm wrote: > Hm, I think that comment is just being a ...
3 years, 6 months ago (2017-05-29 10:52:10 UTC) #12
Alexey Seren
Hey mattm, Thank you for detailed explanation of possible issues! I have found the way ...
3 years, 6 months ago (2017-05-29 11:10:35 UTC) #13
Alexey Seren
https://codereview.chromium.org/2880333004/diff/40001/chrome/browser/process_singleton.h File chrome/browser/process_singleton.h (right): https://codereview.chromium.org/2880333004/diff/40001/chrome/browser/process_singleton.h#newcode196 chrome/browser/process_singleton.h:196: bool KillProcessByLockPath(bool is_connected); is_connected indicates whether we connected to ...
3 years, 6 months ago (2017-05-29 11:33:07 UTC) #14
Alexey Seren
PTAL
3 years, 6 months ago (2017-05-31 06:04:16 UTC) #15
mattm
thanks! Just one nit about the cl description. The description overall is good, but the ...
3 years, 6 months ago (2017-06-02 00:21:06 UTC) #16
Alexey Seren
On 2017/06/02 00:21:06, mattm wrote: > thanks! Just one nit about the cl description. The ...
3 years, 6 months ago (2017-06-02 04:22:36 UTC) #18
mattm
lgtm
3 years, 6 months ago (2017-06-02 19:30:10 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2880333004/40001
3 years, 6 months ago (2017-06-03 02:20:53 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/455135)
3 years, 6 months ago (2017-06-03 02:30:08 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2880333004/40001
3 years, 6 months ago (2017-06-03 13:56:48 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/455172)
3 years, 6 months ago (2017-06-03 14:02:34 UTC) #35
jochen (gone - plz use gerrit)
lgtm with nit https://codereview.chromium.org/2880333004/diff/40001/chrome/browser/process_singleton.h File chrome/browser/process_singleton.h (right): https://codereview.chromium.org/2880333004/diff/40001/chrome/browser/process_singleton.h#newcode196 chrome/browser/process_singleton.h:196: bool KillProcessByLockPath(bool is_connected); On 2017/05/29 at ...
3 years, 6 months ago (2017-06-06 15:00:45 UTC) #36
Alexey Seren
Done. Thank you! https://codereview.chromium.org/2880333004/diff/40001/chrome/browser/process_singleton.h File chrome/browser/process_singleton.h (right): https://codereview.chromium.org/2880333004/diff/40001/chrome/browser/process_singleton.h#newcode196 chrome/browser/process_singleton.h:196: bool KillProcessByLockPath(bool is_connected); On 2017/06/06 15:00:44, ...
3 years, 6 months ago (2017-06-06 16:33:38 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2880333004/60001
3 years, 6 months ago (2017-06-06 16:34:27 UTC) #40
commit-bot: I haz the power
3 years, 6 months ago (2017-06-06 18:14:32 UTC) #43
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/67095448eb212b9f8e09f0715156...

Powered by Google App Engine
This is Rietveld 408576698