Make worker error messages more descriptive

This commit is contained in:
Joseph Schorr 2014-08-27 19:02:53 -04:00
parent 97aa2c5aaa
commit 463a3c55c3
2 changed files with 5 additions and 4 deletions

View file

@ -478,6 +478,7 @@ class DockerfileBuildWorker(Worker):
container['Id'], container['Command']) container['Id'], container['Command'])
docker_cl.kill(container['Id']) docker_cl.kill(container['Id'])
self._timeout.set() self._timeout.set()
except ConnectionError as exc: except ConnectionError as exc:
raise WorkerUnhealthyException(exc.message) raise WorkerUnhealthyException(exc.message)

View file

@ -102,8 +102,8 @@ class Worker(object):
logger.debug('Running watchdog.') logger.debug('Running watchdog.')
try: try:
self.watchdog() self.watchdog()
except WorkerUnhealthyException: except WorkerUnhealthyException as exc:
logger.error('The worker has encountered an error and will not take new jobs.') 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.mark_current_incomplete(restore_retry=True)
self._stop.set() self._stop.set()
@ -133,8 +133,8 @@ class Worker(object):
logger.warning('An error occurred processing request: %s', current_queue_item.body) logger.warning('An error occurred processing request: %s', current_queue_item.body)
self.mark_current_incomplete(restore_retry=False) self.mark_current_incomplete(restore_retry=False)
except WorkerUnhealthyException: except WorkerUnhealthyException as exc:
logger.error('The worker has encountered an error and will not take new jobs. Job is being requeued.') 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.mark_current_incomplete(restore_retry=True)
self._stop.set() self._stop.set()