Commit ff11329d authored by szager@chromium.org's avatar szager@chromium.org

Disabled threaded index-pack for known difficult repositories.

BUG=349576
R=mmoss@google.com

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@259164 0039d316-1c4b-4281-b951-d872f2087c98
parent bda475e2
...@@ -255,7 +255,7 @@ class GitWrapper(SCMWrapper): ...@@ -255,7 +255,7 @@ class GitWrapper(SCMWrapper):
quiet = ['--quiet'] quiet = ['--quiet']
self._UpdateBranchHeads(options, fetch=False) self._UpdateBranchHeads(options, fetch=False)
cfg = gclient_utils.DefaultIndexPackConfig() cfg = gclient_utils.DefaultIndexPackConfig(self.url)
fetch_cmd = cfg + ['fetch', self.remote, '--prune'] fetch_cmd = cfg + ['fetch', self.remote, '--prune']
self._Run(fetch_cmd + quiet, options, retry=True) self._Run(fetch_cmd + quiet, options, retry=True)
self._Run(['reset', '--hard', revision] + quiet, options) self._Run(['reset', '--hard', revision] + quiet, options)
...@@ -725,7 +725,7 @@ class GitWrapper(SCMWrapper): ...@@ -725,7 +725,7 @@ class GitWrapper(SCMWrapper):
print('') print('')
template_path = os.path.join( template_path = os.path.join(
os.path.dirname(THIS_FILE_PATH), 'git-templates') os.path.dirname(THIS_FILE_PATH), 'git-templates')
cfg = gclient_utils.DefaultIndexPackConfig() cfg = gclient_utils.DefaultIndexPackConfig(self.url)
clone_cmd = cfg + [ clone_cmd = cfg + [
'clone', '--no-checkout', '--progress', '--template=%s' % template_path] 'clone', '--no-checkout', '--progress', '--template=%s' % template_path]
if self.cache_dir: if self.cache_dir:
...@@ -937,7 +937,7 @@ class GitWrapper(SCMWrapper): ...@@ -937,7 +937,7 @@ class GitWrapper(SCMWrapper):
'^\\+refs/branch-heads/\\*:.*$'] '^\\+refs/branch-heads/\\*:.*$']
self._Run(config_cmd, options) self._Run(config_cmd, options)
if fetch: if fetch:
cfg = gclient_utils.DefaultIndexPackConfig() cfg = gclient_utils.DefaultIndexPackConfig(self.url)
fetch_cmd = cfg + ['fetch', self.remote] fetch_cmd = cfg + ['fetch', self.remote]
if options.verbose: if options.verbose:
fetch_cmd.append('--verbose') fetch_cmd.append('--verbose')
......
...@@ -30,6 +30,14 @@ RETRY_INITIAL_SLEEP = 0.5 ...@@ -30,6 +30,14 @@ RETRY_INITIAL_SLEEP = 0.5
_WARNINGS = [] _WARNINGS = []
# These repos are known to cause OOM errors on 32-bit platforms, due the the
# very large objects they contain. It is not safe to use threaded index-pack
# when cloning/fetching them.
THREADED_INDEX_PACK_BLACKLIST = [
'https://chromium.googlesource.com/chromium/reference_builds/chrome_win.git'
]
class Error(Exception): class Error(Exception):
"""gclient exception class.""" """gclient exception class."""
def __init__(self, msg, *args, **kwargs): def __init__(self, msg, *args, **kwargs):
...@@ -990,10 +998,13 @@ def DefaultDeltaBaseCacheLimit(): ...@@ -990,10 +998,13 @@ def DefaultDeltaBaseCacheLimit():
else: else:
return '512m' return '512m'
def DefaultIndexPackConfig(): def DefaultIndexPackConfig(url=''):
"""Return reasonable default values for configuring git-index-pack. """Return reasonable default values for configuring git-index-pack.
Experiments suggest that higher values for pack.threads don't improve Experiments suggest that higher values for pack.threads don't improve
performance.""" performance."""
return ['-c', 'pack.threads=5', '-c', cache_limit = DefaultDeltaBaseCacheLimit()
'core.deltaBaseCacheLimit=%s' % DefaultDeltaBaseCacheLimit()] result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit]
if url in THREADED_INDEX_PACK_BLACKLIST:
result.extend(['-c', 'pack.threads=1'])
return result
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment