From 2e864173297dfe9014cf48e596a44b48320a4d26 Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Thu, 29 Jan 2015 10:56:57 -0500 Subject: [PATCH] Allow the buildman server to die if an uncaught exception terminates the scheduler process. --- buildman/server.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/buildman/server.py b/buildman/server.py index 369f90313..d8702d962 100644 --- a/buildman/server.py +++ b/buildman/server.py @@ -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