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

Issue 23875041: Added SafeRename to better handle problems with git processes locking directories. (Closed)

Created:
7 years, 3 months ago by karmann
Modified:
7 years, 3 months ago
Reviewers:
M-A Ruel
CC:
chromium-reviews, Dirk Pranke, cmp-cc_chromium.org, M-A Ruel, iannucci+depot_tools_chromium.org, ilevy-cc_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Visibility:
Public.

Description

Added SafeRename to better handle problems with git processes locking directories. This solves a problem with "os.rename" sometimes failing with an exception after cloning a dependency to a temporary directory. It's possible the dying git processes still hold a handle to the directory. Since gclient delete the temporary directory regardless of the success of the process, it results in a lot of GB downloaded for nothing. SafeRename solves this by retrying a few times if the renaming fails, sleeping one second every time to get other processes the time to release their lock on the directory. It gives up retrying after 15 times. BUG= R=maruel@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=224372

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fixing name and retry count. #

Patch Set 3 : Fixing comment formatting. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -4 lines) Patch
M gclient_scm.py View 1 1 chunk +2 lines, -2 lines 0 comments Download
M gclient_utils.py View 1 2 1 chunk +23 lines, -0 lines 0 comments Download
M tests/gclient_utils_test.py View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
karmann
7 years, 3 months ago (2013-09-18 03:45:16 UTC) #1
M-A Ruel
https://codereview.chromium.org/23875041/diff/1/gclient_utils.py File gclient_utils.py (right): https://codereview.chromium.org/23875041/diff/1/gclient_utils.py#newcode99 gclient_utils.py:99: def SafeRename(old, new): Use safe_rename instead, we're slowly moving ...
7 years, 3 months ago (2013-09-18 18:36:15 UTC) #2
karmann
Thanks for reviewing. https://codereview.chromium.org/23875041/diff/1/gclient_utils.py File gclient_utils.py (right): https://codereview.chromium.org/23875041/diff/1/gclient_utils.py#newcode99 gclient_utils.py:99: def SafeRename(old, new): On 2013/09/18 18:36:16, ...
7 years, 3 months ago (2013-09-20 03:35:29 UTC) #3
M-A Ruel
lgtm lgtm Notes that it's likely related to your AV. They are silly.
7 years, 3 months ago (2013-09-20 13:16:51 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cyrille@nnamrak.org/23875041/8001
7 years, 3 months ago (2013-09-20 13:17:04 UTC) #5
commit-bot: I haz the power
7 years, 3 months ago (2013-09-20 13:19:09 UTC) #6
Message was sent while issue was closed.
Change committed as 224372

Powered by Google App Engine
This is Rietveld 408576698