summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2018-12-03 08:32:28 -0800
committerJames E. Blair <jeblair@redhat.com>2018-12-03 08:32:28 -0800
commite2887fea7079bb5a9ed3342c2ee1995bcd56a1a8 (patch)
tree73eb9767de1f70e8c1b14475d8eabfd0de0ad04f
parent9f849e1f9935c366f99181ee115a06bdc8cac505 (diff)
Don't calculate priority of non-live items
Two earlier adjustments to the dynamic node priority removed non-live items from the count of items in the queue and then protected against the case where processOneItem attempted to calculate the priority of a non-live item. Instead, just avoid calling getNodePriority from processOneItem if the item is not live (it has no node requests), and for efficiency, remove the safety check in getNodePriority which should no longer be necessary. Change-Id: Ibcf26664f3721961d8e767776f2128ec4298ffd0
Notes
Notes (review): Code-Review+2: Tobias Henkel <tobias.henkel@bmw.de> Code-Review+2: Monty Taylor <mordred@inaugust.com> Workflow+1: Monty Taylor <mordred@inaugust.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 03 Dec 2018 18:07:44 +0000 Reviewed-on: https://review.openstack.org/621626 Project: openstack-infra/zuul Branch: refs/heads/master
-rw-r--r--zuul/manager/__init__.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/zuul/manager/__init__.py b/zuul/manager/__init__.py
index 775c590..c060ff6 100644
--- a/zuul/manager/__init__.py
+++ b/zuul/manager/__init__.py
@@ -90,10 +90,7 @@ class PipelineManager(object):
90 items = [i for i in items 90 items = [i for i in items
91 if i.change.project == item.change.project and 91 if i.change.project == item.change.project and
92 i.live] 92 i.live]
93 for idx, val in enumerate(items): 93 return items.index(item)
94 if item == val:
95 return idx
96 return len(items)
97 94
98 def isChangeAlreadyInPipeline(self, change): 95 def isChangeAlreadyInPipeline(self, change):
99 # Checks live items in the pipeline 96 # Checks live items in the pipeline
@@ -701,7 +698,7 @@ class PipelineManager(object):
701 if failing_reasons: 698 if failing_reasons:
702 self.log.debug("%s is a failing item because %s" % 699 self.log.debug("%s is a failing item because %s" %
703 (item, failing_reasons)) 700 (item, failing_reasons))
704 if not dequeued and self.sched.use_relative_priority: 701 if item.live and not dequeued and self.sched.use_relative_priority:
705 priority = item.getNodePriority() 702 priority = item.getNodePriority()
706 for node_request in item.current_build_set.node_requests.values(): 703 for node_request in item.current_build_set.node_requests.values():
707 if node_request.relative_priority != priority: 704 if node_request.relative_priority != priority: