Skip to content
  • aseren's avatar
    Fix process_singleton_posix handling of hostname changes not deleting a stale · 67095448
    aseren authored
    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}
    67095448