From 6fdfd6103f46144e6a14d040d9b2a803c5b96c0d Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 1 Dec 2018 18:06:53 +0800 Subject: [PATCH] ctlmgr: do not raise exceptions in Controllers.__setitem__. Closes #1198 --- artiq/devices/ctlmgr.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/artiq/devices/ctlmgr.py b/artiq/devices/ctlmgr.py index 69dd1b4db..52f203545 100644 --- a/artiq/devices/ctlmgr.py +++ b/artiq/devices/ctlmgr.py @@ -178,13 +178,17 @@ class Controllers: raise ValueError def __setitem__(self, k, v): - if (isinstance(v, dict) and v["type"] == "controller" and - self.host_filter in get_ip_addresses(v["host"])): - v["command"] = v["command"].format(name=k, - bind=self.host_filter, - port=v["port"]) - self.queue.put_nowait(("set", (k, v))) - self.active_or_queued.add(k) + try: + if (isinstance(v, dict) and v["type"] == "controller" and + self.host_filter in get_ip_addresses(v["host"])): + v["command"] = v["command"].format(name=k, + bind=self.host_filter, + port=v["port"]) + self.queue.put_nowait(("set", (k, v))) + self.active_or_queued.add(k) + except: + logger.error("Failed to process device database entry %s", k, + exc_info=True) def __delitem__(self, k): if k in self.active_or_queued: