From f8b0b3ba6f50dd999c5e64c2e6f877ef057206b7 Mon Sep 17 00:00:00 2001 From: "Daryin, Alexander" Date: Sat, 25 Oct 2014 22:52:47 +0400 Subject: [PATCH 1/2] Add error handling during node discovery. --- rdma/discovery.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rdma/discovery.py b/rdma/discovery.py index 880cd5a..2f97594 100644 --- a/rdma/discovery.py +++ b/rdma/discovery.py @@ -1,5 +1,6 @@ # Copyright 2011 Obsidian Research Corp. GPLv2, see COPYING. import rdma; +import logging; import collections; import rdma.path; import rdma.satransactor; @@ -319,7 +320,12 @@ def do_port(self,path,node,aport,portIdx,depth): def do_node(self,path,depth=0,peer=None): """Coroutine to get the :class:`~rdma.IBA.SMPNodeInfo` and scan all the port infos.""" - ninf = yield self.sched.SubnGet(IBA.SMPNodeInfo,path); + try: + ninf = yield self.sched.SubnGet(IBA.SMPNodeInfo,path); + except rdma.RDMAError as err: + logging.error(err) + return + node,port = self.sbn.get_node_ninf(ninf,path); if isinstance(node,rdma.subnet.Switch): From 4ada0ab90651cf8c6998163ad1e40e27222b92fc Mon Sep 17 00:00:00 2001 From: "Daryin, Alexander" Date: Sat, 25 Oct 2014 22:55:26 +0400 Subject: [PATCH 2/2] Add error handling during port discovery. --- rdma/discovery.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rdma/discovery.py b/rdma/discovery.py index 2f97594..0806c74 100644 --- a/rdma/discovery.py +++ b/rdma/discovery.py @@ -294,7 +294,12 @@ def do_todo(self,old_ctx,bucket,depth): def do_port(self,path,node,aport,portIdx,depth): """Coroutine to get a :class:`~rdma.IBA.SMPPortInfo` and schedule scanning the attached node, if applicable.""" - pinf = yield self.sched.SubnGet(IBA.SMPPortInfo,path,portIdx); + try: + pinf = yield self.sched.SubnGet(IBA.SMPPortInfo,path,portIdx) + except rdma.RDMAError as e: + logging.error(e) + pinf = IBA.SMPPortInfo() + pinf.portState = IBA.PORT_STATE_DOWN aport = self.sbn.get_port_pinf(pinf,path=path,portIdx=portIdx); if self.lid_route and isinstance(path,rdma.path.IBDRPath):