log = logging.getLogger(__name__)
start_time = datetime.utcnow()
restart_file_path = '/tmp/teuthology-restart-workers'
+stop_file_path = '/tmp/teuthology-stop-workers'
def sentinel(path):
os.execv(sys.executable, args)
+def stop():
+ log.info('Stopping...')
+ sys.exit(0)
+
+
def install_except_hook():
"""
Install an exception hook that first logs any uncaught exception, then
if sentinel(restart_file_path):
restart()
+ elif sentinel(stop_file_path):
+ stop()
job = connection.reserve(timeout=60)
if job is None: