python-rdma
python-rdma copied to clipboard
Discovery fails on broken links
Hi, Jason!
If a bad link is encountered, the subnet discovery fails with an exception. Here is a simple patch to ignore bad links.
Best regards, Alexander Daryin
--- discovery.py 2012-08-28 16:38:26.000000000 +0400
+++ discovery2.py 2012-08-31 21:21:55.294313560 +0400
@@ -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_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):
This seems like a good improvement until a generally more complete way of handling discovery errors could be implemented. What I had in mind was removing all the failed links from the main topology and keeping a separate list of failed links for later reporting..