Allow the buildman server to die if an uncaught exception terminates the scheduler process.

This commit is contained in:
Jake Moshenko 2015-01-29 10:56:57 -05:00
parent c308794063
commit 2e86417329

View file

@ -76,12 +76,11 @@ class BuilderServer(object):
logger.debug('Initializing all members of the event loop')
loop = trollius.get_event_loop()
trollius.Task(self._initialize(loop, host, websocket_port, controller_port, ssl))
logger.debug('Starting server on port %s, with controller on port %s', websocket_port,
controller_port)
try:
loop.run_forever()
loop.run_until_complete(self._initialize(loop, host, websocket_port, controller_port, ssl))
except KeyboardInterrupt:
pass
finally:
@ -163,8 +162,6 @@ class BuilderServer(object):
logger.debug('All workers are busy. Requeuing.')
self._queue.incomplete(job_item, restore_retry=True, retry_after=0)
yield From(trollius.sleep(WORK_CHECK_TIMEOUT))
@trollius.coroutine
def _initialize(self, loop, host, websocket_port, controller_port, ssl=None):
self._loop = loop