mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
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 Review URL: https://chromiumcodereview.appspot.com/23875041 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@224372 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@@ -38,8 +38,8 @@ class GclientUtilsUnittest(GclientUtilBase):
|
||||
'GCLIENT_CHILDREN_LOCK', 'GClientChildren',
|
||||
'SplitUrlRevision', 'SyntaxErrorToError', 'UpgradeToHttps', 'Wrapper',
|
||||
'WorkItem', 'codecs', 'lockedmethod', 'logging', 'os', 'pipes', 'Queue',
|
||||
're', 'rmtree', 'safe_makedirs', 'stat', 'subprocess', 'subprocess2',
|
||||
'sys', 'tempfile', 'threading', 'time', 'urlparse',
|
||||
're', 'rmtree', 'safe_makedirs', 'safe_rename', 'stat', 'subprocess',
|
||||
'subprocess2', 'sys', 'tempfile', 'threading', 'time', 'urlparse',
|
||||
]
|
||||
# If this test fails, you should add the relevant test.
|
||||
self.compareMembers(gclient_utils, members)
|
||||
|
||||
Reference in New Issue
Block a user