diff options
author | David James <davidjames@google.com> | 2015-03-26 13:36:50 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-03-27 01:34:44 +0000 |
commit | bf8ca3014451f6c8ceee5cae74dd2ff4d2b9a163 (patch) | |
tree | bc63942c7d4c89bc864b864cd47444e27969ec1f /cbuildbot/binhost.py | |
parent | 26ddf3010d3906d574bb63fe5e06129e9efa8772 (diff) | |
download | chromite-bf8ca3014451f6c8ceee5cae74dd2ff4d2b9a163.tar.gz |
Workaround portage cache parallelism bug.
Portage cache updates aren't parallel safe, so, as a workaround, make
sure the cache is up to date before we start running processes in
parallel and have multiple processes all trying to update the cache at
once.
BUG=chromium:470998, chromium:443254
TEST=Run the test locally.
Change-Id: I5e88d5fdf67f8c3f517f8edbecefab9dec9bad6b
Reviewed-on: https://chromium-review.googlesource.com/262705
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Trybot-Ready: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Diffstat (limited to 'cbuildbot/binhost.py')
-rw-r--r-- | cbuildbot/binhost.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cbuildbot/binhost.py b/cbuildbot/binhost.py index 11b50b6d4..c1885be7d 100644 --- a/cbuildbot/binhost.py +++ b/cbuildbot/binhost.py @@ -287,6 +287,11 @@ class CompatIdFetcher(object): # pylint: disable=method-hidden logging.info('Fetching CompatId objects...') with parallel.Manager() as manager: + # Fetching the first key updates the cache, so do that first before + # launching a bunch of parallel jobs. This is needed because Portage + # cache updates aren't parallel-safe. See http://crbug.com/470998 self.compat_ids = manager.dict() - parallel.RunTasksInProcessPool(self._FetchCompatId, board_keys) + if board_keys: + self._FetchCompatId(*board_keys[0]) + parallel.RunTasksInProcessPool(self._FetchCompatId, board_keys[1:]) return dict(self.compat_ids) |