Repository navigation
fix(browser): reap Chrome and profiles orphaned by killed runs - #811
Merged
Merged
Conversation
A run ended by SIGKILL, a supervisor or a test timeout never reaches close() or Drop, so its headless Chrome kept running under init and its auditmysite-chrome-* profile stayed in the temp dir (1324 profiles, 3.3 GB here after four days). Before the first launch, a profile whose owning process is gone is removed; the Chrome named in its SingletonLock is ended first, but only if its command line runs on that profile. mutation-check.py runs each test in its own process group and kills the group on a timeout or Ctrl-C, instead of only cargo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Headless Chrome instances kept running after auditmysite was killed from outside (SIGKILL, a supervisor or test timeout):
close()andDropnever run in that case, so Chrome ended up under init and itsauditmysite-chrome-*profile stayed in the temp dir. Locally that was one live orphan and 1324 profiles (3.3 GB) after four days of test and mutation runs.Browser start (
src/browser/manager.rs): before the first launch of a process, everyauditmysite-chrome-<pid>-…profile whose owning process is gone is removed. The Chrome still holding it (pid from Chrome's ownSingletonLock) is ended first with TERM, then KILL — only if its command line runs on that very profile, so a reused pid is never killed. Live owners keep their profiles; foreign directories are not touched. Unix only; a no-op elsewhere.mutation-check.py: each test runs in its own process group; a timeout or Ctrl-C kills the group instead of only
cargo, which had left the test binary and its Chrome running.Verified:
Removed 1 orphaned browser profile(s), the orphan was gone and the audit wrote its reportpasses()timeout kills grandchildren of the test command-D warningswith and without features