Browse Source

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
tags/3.6.0
Tobias Henkel 5 months ago
parent
commit
e207432a41
No account linked to committer's email address
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      zuul/manager/__init__.py

+ 5
- 5
zuul/manager/__init__.py View File

@@ -277,11 +277,6 @@ class PipelineManager(object):
277 277
                            "ignoring" % change)
278 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 280
         if not ignore_requirements:
286 281
             for f in self.ref_filters:
287 282
                 if f.connection_name != change.project.connection_name:
@@ -293,6 +288,11 @@ class PipelineManager(object):
293 288
                                    "requirement %s" % (change, f))
294 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 296
         with self.getChangeQueue(change, change_queue) as change_queue:
297 297
             if not change_queue:
298 298
                 self.log.debug("Unable to find change queue for "

Loading…
Cancel
Save