Allow zuul to cleanup jobs outside window
Zuul's new rate limiting feature would ignore jobs started that are later moved outside the window (due to the window shrinking). Zuul properly dealt with this jobs and changes when they slid back into the window but it did so inefficiently. Go back to processing the entire queue but check if each individual item is actionable before preparing refs on it or starting jobs. Change-Id: Ib76a68f9023652205003e0d164a78b8f67956adf
This commit is contained in:
parent
7603a37725
commit
3d2f7a7373
|
@ -60,7 +60,7 @@ class LayoutSchema(object):
|
||||||
'subject': str,
|
'subject': str,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
window = v.All(int, v.Range(min=1))
|
window = v.All(int, v.Range(min=0))
|
||||||
window_floor = v.All(int, v.Range(min=1))
|
window_floor = v.All(int, v.Range(min=1))
|
||||||
window_type = v.Any('linear', 'exponential')
|
window_type = v.Any('linear', 'exponential')
|
||||||
window_factor = v.All(int, v.Range(min=1))
|
window_factor = v.All(int, v.Range(min=1))
|
||||||
|
|
|
@ -461,11 +461,11 @@ class ChangeQueue(object):
|
||||||
self.window = min(self.window, other.window)
|
self.window = min(self.window, other.window)
|
||||||
# TODO merge semantics
|
# TODO merge semantics
|
||||||
|
|
||||||
def getActionableItems(self):
|
def isActionable(self, item):
|
||||||
if self.dependent and self.window:
|
if self.dependent and self.window:
|
||||||
return self.queue[:self.window]
|
return item in self.queue[:self.window]
|
||||||
else:
|
else:
|
||||||
return self.queue[:]
|
return True
|
||||||
|
|
||||||
def increaseWindowSize(self):
|
def increaseWindowSize(self):
|
||||||
if self.dependent:
|
if self.dependent:
|
||||||
|
|
|
@ -1149,10 +1149,11 @@ class BasePipelineManager(object):
|
||||||
change_queue.moveItem(item, nnfi)
|
change_queue.moveItem(item, nnfi)
|
||||||
changed = True
|
changed = True
|
||||||
self.cancelJobs(item)
|
self.cancelJobs(item)
|
||||||
self.prepareRef(item)
|
if change_queue.isActionable(item):
|
||||||
if item.current_build_set.unable_to_merge:
|
self.prepareRef(item)
|
||||||
failing_reasons.append("it has a merge conflict")
|
if item.current_build_set.unable_to_merge:
|
||||||
if self.launchJobs(item):
|
failing_reasons.append("it has a merge conflict")
|
||||||
|
if change_queue.isActionable(item) and self.launchJobs(item):
|
||||||
changed = True
|
changed = True
|
||||||
if self.pipeline.didAnyJobFail(item):
|
if self.pipeline.didAnyJobFail(item):
|
||||||
failing_reasons.append("at least one job failed")
|
failing_reasons.append("at least one job failed")
|
||||||
|
@ -1183,7 +1184,7 @@ class BasePipelineManager(object):
|
||||||
for queue in self.pipeline.queues:
|
for queue in self.pipeline.queues:
|
||||||
queue_changed = False
|
queue_changed = False
|
||||||
nnfi = None # Nearest non-failing item
|
nnfi = None # Nearest non-failing item
|
||||||
for item in queue.getActionableItems():
|
for item in queue.queue[:]:
|
||||||
item_changed, nnfi = self._processOneItem(item, nnfi)
|
item_changed, nnfi = self._processOneItem(item, nnfi)
|
||||||
if item_changed:
|
if item_changed:
|
||||||
queue_changed = True
|
queue_changed = True
|
||||||
|
|
Loading…
Reference in New Issue