From 463a3c55c3ed70220dfd402cea94d4b46ca1945f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 27 Aug 2014 19:02:53 -0400 Subject: [PATCH] Make worker error messages more descriptive --- workers/dockerfilebuild.py | 1 + workers/worker.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/workers/dockerfilebuild.py b/workers/dockerfilebuild.py index 9d3e92ae7..2b79aa084 100644 --- a/workers/dockerfilebuild.py +++ b/workers/dockerfilebuild.py @@ -478,6 +478,7 @@ class DockerfileBuildWorker(Worker): container['Id'], container['Command']) docker_cl.kill(container['Id']) self._timeout.set() + except ConnectionError as exc: raise WorkerUnhealthyException(exc.message) diff --git a/workers/worker.py b/workers/worker.py index c29d10f41..57d4a02d0 100644 --- a/workers/worker.py +++ b/workers/worker.py @@ -102,8 +102,8 @@ class Worker(object): logger.debug('Running watchdog.') try: self.watchdog() - except WorkerUnhealthyException: - logger.error('The worker has encountered an error and will not take new jobs.') + except WorkerUnhealthyException as exc: + logger.error('The worker has encountered an error via watchdog and will not take new jobs: %s' % exc.message) self.mark_current_incomplete(restore_retry=True) self._stop.set() @@ -133,8 +133,8 @@ class Worker(object): logger.warning('An error occurred processing request: %s', current_queue_item.body) self.mark_current_incomplete(restore_retry=False) - except WorkerUnhealthyException: - logger.error('The worker has encountered an error and will not take new jobs. Job is being requeued.') + except WorkerUnhealthyException as exc: + logger.error('The worker has encountered an error via the job and will not take new jobs: %s' % exc.message) self.mark_current_incomplete(restore_retry=True) self._stop.set()