Browse Source

Merge "Defer setting build pause to event queue"

changes/74/777874/1
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
6098cb066c
2 changed files with 8 additions and 5 deletions
  1. +3
    -5
      zuul/executor/client.py
  2. +5
    -0
      zuul/scheduler.py

+ 3
- 5
zuul/executor/client.py View File

@ -488,11 +488,9 @@ class ExecutorClient(object):
build.worker.updateFromData(data)
build.__gearman_worker = build.worker.name
if 'paused' in data and build.paused != data['paused']:
build.paused = data['paused']
if build.paused:
result_data = data.get('data', {})
self.sched.onBuildPaused(build, result_data)
if 'paused' in data:
result_data = data.get('data', {})
self.sched.onBuildPaused(build, result_data)
if not started:
self.log.info("Build %s started" % job)


+ 5
- 0
zuul/scheduler.py View File

@ -1445,6 +1445,11 @@ class Scheduler(threading.Thread):
def _doBuildPausedEvent(self, event):
build = event.build
# Setting paused is deferred to event processing stage to avoid a race
# with child job skipping.
build.paused = True
log = get_annotated_logger(self.log, build.zuul_event_id)
if build.build_set is not build.build_set.item.current_build_set:
log.warning("Build %s is not in the current build set", build)


Loading…
Cancel
Save