mirror of https://github.com/m-labs/artiq.git
ctlmgr: catch create_subprocess_exec errors and retry
This commit is contained in:
parent
96a01efc48
commit
abb7d9f911
|
@ -47,8 +47,12 @@ class Controller:
|
||||||
while True:
|
while True:
|
||||||
logger.info("Starting controller %s with command: %s",
|
logger.info("Starting controller %s with command: %s",
|
||||||
name, command)
|
name, command)
|
||||||
|
try:
|
||||||
process = yield from asyncio.create_subprocess_exec(*command.split())
|
process = yield from asyncio.create_subprocess_exec(*command.split())
|
||||||
yield from asyncio.shield(process.wait())
|
yield from asyncio.shield(process.wait())
|
||||||
|
except FileNotFoundError:
|
||||||
|
logger.warning("Controller %s failed to start", name)
|
||||||
|
else:
|
||||||
logger.warning("Controller %s exited", name)
|
logger.warning("Controller %s exited", name)
|
||||||
logger.warning("Restarting in %.1f seconds", retry)
|
logger.warning("Restarting in %.1f seconds", retry)
|
||||||
yield from asyncio.sleep(retry)
|
yield from asyncio.sleep(retry)
|
||||||
|
|
Loading…
Reference in New Issue