diff options
author | James E. Blair <jeblair@hp.com> | 2014-08-15 15:40:14 -0700 |
---|---|---|
committer | James E. Blair <jeblair@hp.com> | 2014-08-15 15:45:54 -0700 |
commit | e2259ea455273cdb71e86753cda776f3054ecc06 (patch) | |
tree | c9df8cbc39dc3e11d14d6b4412a54e2fd0da7173 | |
parent | f8ff9937b5255561f532963c53bf4ec6ec138f27 (diff) | |
download | zuul-e2259ea455273cdb71e86753cda776f3054ecc06.tar.gz |
Stop removing changes from the cache
The zuul trigger ends up querying a large number of changes on
each merge, most of which are not in any pipelines. To avoid
needlessly querying gerrit for data that do not change, keep
all changes that Zuul ever sees in the cache.
We could consider removing changes that are both not in pipelines
and closed (ie, keep all open changes), but we still end up querying
a number of merged changes each time due to Zuul following
dependencies of open changes.
Change-Id: Ie78df9aa43ec5ac35bdea79dcdafdfdd41d51d5b
-rwxr-xr-x | tests/base.py | 3 | ||||
-rw-r--r-- | zuul/trigger/gerrit.py | 10 |
2 files changed, 3 insertions, 10 deletions
diff --git a/tests/base.py b/tests/base.py index 5f1529767..179f4f484 100755 --- a/tests/base.py +++ b/tests/base.py @@ -946,9 +946,6 @@ class ZuulTestCase(testtools.TestCase): self.config.read(os.path.join(FIXTURE_DIR, "zuul.conf")) def assertFinalState(self): - # Make sure that the change cache is cleared - self.assertEqual(len(self.gerrit._change_cache.keys()), 0, - "Change cache should have been cleared") # Make sure that git.Repo objects have been garbage collected. repos = [] gc.collect() diff --git a/zuul/trigger/gerrit.py b/zuul/trigger/gerrit.py index d05fc69b5..754c94270 100644 --- a/zuul/trigger/gerrit.py +++ b/zuul/trigger/gerrit.py @@ -279,13 +279,9 @@ class Gerrit(object): def maintainCache(self, relevant): # This lets the user supply a list of change objects that are # still in use. Anything in our cache that isn't in the supplied - # list should be same to remove from the cache. - remove = [] - for key, change in self._change_cache.items(): - if change not in relevant: - remove.append(key) - for key in remove: - del self._change_cache[key] + # list should be safe to remove from the cache. + # TODO(jeblair): consider removing this feature + return def postConfig(self): pass |