summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Henkel <tobias.henkel@bmw.de>2019-01-31 10:53:45 +0100
committerTobias Henkel <tobias.henkel@bmw.de>2019-01-31 10:53:45 +0100
commite207432a412b8361a527098114490ed6bfdb9726 (patch)
tree59115df61671df7d402aa50a1f0cea997c2aaa81
parent363d881ab9291a2bbca4c0f3c270b873fd2ad009 (diff)
Move isChangeReadyToBeEnqueued after pipeline requirements
When adding a change to a pipeline we have two filter steps before getting the change queue and doing further checks. The first one calls isChangeReadyToBeEnqueued which is used by the dependent pipeline manager to check if a change can merge. This causes potentially various api calls as this updates the change, analyzes status checks etc and thus is potentially expensive. The check for pipeline requirements is purely local and thus cheap. In many cases the pipeline requirements could filter out changes before the can merge check. Switching these two filters can save us some api calls and improve the performance of the scheduler run_handler loop. Change-Id: I3d3ea186e7852ae9c253d29f78dd5d7df81e71aa
Notes
Notes (review): Code-Review+2: James E. Blair <corvus@inaugust.com> Code-Review+2: Monty Taylor <mordred@inaugust.com> Workflow+1: Monty Taylor <mordred@inaugust.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 04 Feb 2019 19:48:02 +0000 Reviewed-on: https://review.openstack.org/634191 Project: openstack-infra/zuul Branch: refs/heads/master
-rw-r--r--zuul/manager/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/zuul/manager/__init__.py b/zuul/manager/__init__.py
index 359d73d..326bbfd 100644
--- a/zuul/manager/__init__.py
+++ b/zuul/manager/__init__.py
@@ -277,11 +277,6 @@ class PipelineManager(object):
277 "ignoring" % change) 277 "ignoring" % change)
278 return True 278 return True
279 279
280 if not self.isChangeReadyToBeEnqueued(change):
281 self.log.debug("Change %s is not ready to be enqueued, ignoring" %
282 change)
283 return False
284
285 if not ignore_requirements: 280 if not ignore_requirements:
286 for f in self.ref_filters: 281 for f in self.ref_filters:
287 if f.connection_name != change.project.connection_name: 282 if f.connection_name != change.project.connection_name:
@@ -293,6 +288,11 @@ class PipelineManager(object):
293 "requirement %s" % (change, f)) 288 "requirement %s" % (change, f))
294 return False 289 return False
295 290
291 if not self.isChangeReadyToBeEnqueued(change):
292 self.log.debug("Change %s is not ready to be enqueued, ignoring" %
293 change)
294 return False
295
296 with self.getChangeQueue(change, change_queue) as change_queue: 296 with self.getChangeQueue(change, change_queue) as change_queue:
297 if not change_queue: 297 if not change_queue:
298 self.log.debug("Unable to find change queue for " 298 self.log.debug("Unable to find change queue for "