Commit 02fc74da authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

workerpool: Simplify log messages

Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent d16e6fd9
......@@ -430,8 +430,7 @@ class _JobQueueWorker(workerpool.BaseWorker):
@param job: the job to be processed
""""Worker %s processing job %s",
self.worker_id,"Processing job %s",
proc = mcpu.Processor(self.pool.queue.context,
queue = job.queue
......@@ -527,8 +526,7 @@ class _JobQueueWorker(workerpool.BaseWorker):
queue.release()"Worker %s finished job %s, status = %s",
self.worker_id, job_id, status)"Finished job %s, status = %s", job_id, status)
class _JobQueueWorkerPool(workerpool.WorkerPool):
......@@ -44,7 +44,6 @@ class BaseWorker(threading.Thread, object):
super(BaseWorker, self).__init__(name=worker_id)
self.pool = pool
self.worker_id = worker_id
self._current_task = None
def ShouldTerminate(self):
......@@ -89,12 +88,12 @@ class BaseWorker(threading.Thread, object):
# We only wait if there's no task for us.
if not pool._tasks:
logging.debug("Worker %s: waiting for tasks", self.worker_id)
logging.debug("Waiting for tasks")
# wait() releases the lock and sleeps until notified
logging.debug("Worker %s: notified while waiting", self.worker_id)
logging.debug("Notified while waiting")
# Were we woken up in order to terminate?
if pool._ShouldWorkerTerminateUnlocked(self):
......@@ -114,14 +113,11 @@ class BaseWorker(threading.Thread, object):
# Run the actual task
logging.debug("Worker %s: starting task %r",
self.worker_id, self._current_task)
logging.debug("Starting task %r", self._current_task)
logging.debug("Worker %s: done with task %r",
self.worker_id, self._current_task)
logging.debug("Done with task %r", self._current_task)
except: # pylint: disable-msg=W0702
logging.error("Worker %s: Caught unhandled exception",
self.worker_id, exc_info=True)
logging.exception("Caught unhandled exception")
# Notify pool
......@@ -132,7 +128,7 @@ class BaseWorker(threading.Thread, object):
logging.debug("Worker %s: terminates", self.worker_id)
def RunTask(self, *args):
"""Function called to start a task.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment