Commit 9751e221 authored by Julien Muchembled's avatar Julien Muchembled

Log unexpected duplicate neighbour, instead of crashing with KeyError

parent 8a1c74d0
...@@ -276,7 +276,20 @@ class Babel(object): ...@@ -276,7 +276,20 @@ class Babel(object):
prefix = ip[a:route.plen] prefix = ip[a:route.plen]
if prefix and not route.refmetric: if prefix and not route.refmetric:
neighbours[prefix] = neigh_routes neighbours[prefix] = neigh_routes
unidentified.remove(address) # XXX: Temporary logging to understand when a KeyError
# happens. Then, we'll problably replace 'remove' by
# 'discard'.
try:
unidentified.remove(address)
except KeyError as e:
logging.warning("address: %s; prefix: %s",
address, prefix)
logging.warning("neighbours: %r", neighbours)
logging.warning("routes: %r", routes)
try:
tm.sendto(tm.cache.registry_prefix, '\7%s' % e)
  • @jm @jhuge

    This line is causing this error:

    2024-01-10 08:32:31 ERROR     NameError: global name 'tm' is not defined
    Traceback (most recent call last):
      File "/opt/re6st/eggs/re6stnet-0.623-py2.7.egg/re6st/cli/node.py", line 434, in main
        s(*args)
      File "/opt/re6st/eggs/re6stnet-0.623-py2.7.egg/re6st/utils.py", line 201, in select
        R[r]()
      File "/opt/re6st/eggs/re6stnet-0.623-py2.7.egg/re6st/ctl.py", line 254, in _read
        h(*packet)
      File "/opt/re6st/eggs/re6stnet-0.623-py2.7.egg/re6st/ctl.py", line 292, in handle_dump
        tm.sendto(tm.cache.registry_prefix, '\7%s' % e)
  • We could fix this commit by replacing tm with self.handler. But maybe now we have enough information to fix the unidentified.remove(address) line.

  • Fixed in f1b9066c.

Please register or sign in to reply
except AttributeError:
pass
else: else:
prefix = None prefix = None
neigh_routes[1][prefix] = route neigh_routes[1][prefix] = route
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment