New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 598366 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Chromedriver blindly clobbers all directories in "/tmp".

Project Member Reported by d...@chromium.org, Mar 28 2016

Issue description

From 

I'm working on testing a new logging system on Chromium waterfalls. This includes bootstrapping builds through a logging client proxy, which owns state in "/tmp/.recipe_engine".

The Chromedriver script ( https://chromium.googlesource.com/chromium/src/+/master/chrome/test/chromedriver/run_buildbot_steps.py#388 ) has a section that forcefully deletes *every* subdirectory under "/tmp", including "/tmp/.recipe_engine", leading to some nasty breakages.

I'm not sure if blindly clobbering everything under "/tmp" has *ever* been safe in a Linux system, but it definitely wrecks the ownership expectations of "annotated_run.py". I'd like to remove the clobbering from the script. Can someone who is more familiar with the script tell me if this is a good idea?

+people who have worked on the script.
 

Comment 1 by d...@chromium.org, Mar 28 2016

(From 596634)
Cc: st...@chromium.org
Looks like this was introduced in https://chromiumcodereview.appspot.com/14301024

+stgao, looks like this is doing a kill -9 on all the stray chrome processes, and attempting to delete any temporary profile directories. Is this correct?

Comment 3 by st...@chromium.org, Mar 28 2016

IIRC, yes. The cleanup of /tmp is because there were a lot of temporary files (created by Chromedriver for --user-data-dir that are used by chrome) that made the disk full, and caused breakage afterwards.

Comment 4 by estaab@google.com, Mar 29 2016

Status: Available (was: Untriaged)
I agree with dnj@ that going for all of /tmp/* is pretty questionable. Looking at the CL it seems it's specifically deleting *directories* in /tmp, but blindly, which is still not great.

I think the right thing to do is:
1) modify src/chrome/test/chromedriver/util.py MakeTempDir() to pass the prefix parameter to mkdtemp, perhaps "chromedriver"
2) only delete directories starting with "chromedriver" in run_buildbot_steps.py

both are 1 line edits. Thanks in advance to whoever writes the CL :)
Owner: samu...@chromium.org
Status: Assigned (was: Available)
I'll have a go at making this change. But if these temp directories are profile directories, then these are created by the ChromeDriver binary itself, not in util.py - MakeTempDir() already calls atexit.register(MaybeDelete, path).

ChromeDriver uses ScopedTempDir, which I think respects $TMPDIR, so maybe we can just set that before launching ChromeDriver.
Project Member

Comment 6 by bugdroid1@chromium.org, Mar 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a05d65bcb2ac1339a99beaa22cf2e9ede5ff7d72

commit a05d65bcb2ac1339a99beaa22cf2e9ede5ff7d72
Author: samuong <samuong@chromium.org>
Date: Wed Mar 30 18:37:53 2016

[chromedriver] Only delete temp files that start with "chromedriver_".

BUG= 598366 

Review URL: https://codereview.chromium.org/1844743002

Cr-Commit-Position: refs/heads/master@{#384032}

[modify] https://crrev.com/a05d65bcb2ac1339a99beaa22cf2e9ede5ff7d72/chrome/test/chromedriver/run_buildbot_steps.py
[modify] https://crrev.com/a05d65bcb2ac1339a99beaa22cf2e9ede5ff7d72/chrome/test/chromedriver/util.py

Project Member

Comment 7 by bugdroid1@chromium.org, Mar 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a05d65bcb2ac1339a99beaa22cf2e9ede5ff7d72

commit a05d65bcb2ac1339a99beaa22cf2e9ede5ff7d72
Author: samuong <samuong@chromium.org>
Date: Wed Mar 30 18:37:53 2016

[chromedriver] Only delete temp files that start with "chromedriver_".

BUG= 598366 

Review URL: https://codereview.chromium.org/1844743002

Cr-Commit-Position: refs/heads/master@{#384032}

[modify] https://crrev.com/a05d65bcb2ac1339a99beaa22cf2e9ede5ff7d72/chrome/test/chromedriver/run_buildbot_steps.py
[modify] https://crrev.com/a05d65bcb2ac1339a99beaa22cf2e9ede5ff7d72/chrome/test/chromedriver/util.py

Status: Fixed (was: Assigned)

Comment 9 by aga...@chromium.org, Apr 27 2016

Components: Infra>Platform
Labels: -Infra-Platform

Sign in to add a comment