Browse Source

Don't use run_lock in executor's merger

The run_lock is used to ensure that the executor has a consistent
list of jobs running.  Specifically, that we don't start a new
job right as we're shutting down and stopping jobs.

When we broke out the executor-merger into its own gearman worker,
we copied the run_lock into that as well.  This means that as long
as a merger job is running, an executor job can't start.

The merger doesn't actually need the run_lock, so remove it.

Change-Id: Ibb96c7e5b6d02962170fbe0c611c1f2665002c47
changes/12/540112/1
James E. Blair 4 years ago
parent
commit
42382a7026
  1. 31
      zuul/executor/server.py

31
zuul/executor/server.py

@ -1890,22 +1890,21 @@ class ExecutorServer(object):
self.log.exception("Exception while getting job")
def mergerJobDispatch(self, job):
with self.run_lock:
if job.name == 'merger:cat':
self.log.debug("Got cat job: %s" % job.unique)
self.cat(job)
elif job.name == 'merger:merge':
self.log.debug("Got merge job: %s" % job.unique)
self.merge(job)
elif job.name == 'merger:refstate':
self.log.debug("Got refstate job: %s" % job.unique)
self.refstate(job)
elif job.name == 'merger:fileschanges':
self.log.debug("Got fileschanges job: %s" % job.unique)
self.fileschanges(job)
else:
self.log.error("Unable to handle job %s" % job.name)
job.sendWorkFail()
if job.name == 'merger:cat':
self.log.debug("Got cat job: %s" % job.unique)
self.cat(job)
elif job.name == 'merger:merge':
self.log.debug("Got merge job: %s" % job.unique)
self.merge(job)
elif job.name == 'merger:refstate':
self.log.debug("Got refstate job: %s" % job.unique)
self.refstate(job)
elif job.name == 'merger:fileschanges':
self.log.debug("Got fileschanges job: %s" % job.unique)
self.fileschanges(job)
else:
self.log.error("Unable to handle job %s" % job.name)
job.sendWorkFail()
def run_executor(self):
self.log.debug("Starting executor listener")

Loading…
Cancel
Save