Make sure the build manager dies on an unhandled schedule exception

This commit is contained in:
Joseph Schorr 2015-02-25 12:19:21 -05:00
parent afe7e14254
commit 390f8df4ad
2 changed files with 4 additions and 1 deletions

View file

@ -10,3 +10,4 @@ class BuildServerStatus(object):
STARTING = 'starting'
RUNNING = 'running'
SHUTDOWN = 'shutting_down'
EXCEPTION = 'exception'

View file

@ -180,7 +180,8 @@ class BuilderServer(object):
scheduled = yield From(self._lifecycle_manager.schedule(build_job))
except:
logger.exception('Exception when scheduling job')
scheduled = None
self._current_status = BuildServerStatus.EXCEPTION
return
if scheduled:
status_handler = StatusHandler(self._build_logs, build_job.repo_build.uuid)
@ -196,6 +197,7 @@ class BuilderServer(object):
def _queue_metrics_updater(self):
while self._current_status == BuildServerStatus.RUNNING:
yield From(trollius.sleep(30))
logger.debug('Writing metrics')
self._queue.update_metrics()
@trollius.coroutine