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
This commit is contained in:
parent
9f849e1f99
commit
e2887fea70
@ -90,10 +90,7 @@ class PipelineManager(object):
|
|||||||
items = [i for i in items
|
items = [i for i in items
|
||||||
if i.change.project == item.change.project and
|
if i.change.project == item.change.project and
|
||||||
i.live]
|
i.live]
|
||||||
for idx, val in enumerate(items):
|
return items.index(item)
|
||||||
if item == val:
|
|
||||||
return idx
|
|
||||||
return len(items)
|
|
||||||
|
|
||||||
def isChangeAlreadyInPipeline(self, change):
|
def isChangeAlreadyInPipeline(self, change):
|
||||||
# Checks live items in the pipeline
|
# Checks live items in the pipeline
|
||||||
@ -701,7 +698,7 @@ class PipelineManager(object):
|
|||||||
if failing_reasons:
|
if failing_reasons:
|
||||||
self.log.debug("%s is a failing item because %s" %
|
self.log.debug("%s is a failing item because %s" %
|
||||||
(item, failing_reasons))
|
(item, failing_reasons))
|
||||||
if not dequeued and self.sched.use_relative_priority:
|
if item.live and not dequeued and self.sched.use_relative_priority:
|
||||||
priority = item.getNodePriority()
|
priority = item.getNodePriority()
|
||||||
for node_request in item.current_build_set.node_requests.values():
|
for node_request in item.current_build_set.node_requests.values():
|
||||||
if node_request.relative_priority != priority:
|
if node_request.relative_priority != priority:
|
||||||
|
Loading…
Reference in New Issue
Block a user