Hi,
Sorry for delay.
When we shutdown the BGPSpeaker,
threads associated with each neighbors don't seem to be stopped.
I think this causes the problem.
I wrote the patch for this:
diff --git a/ryu/services/protocols/bgp/base.py
b/ryu/services/protocols/bgp/base.py
index 8b69aa3..37d42a9 100644
--- a/ryu/services/protocols/bgp/base.py
+++ b/ryu/services/protocols/bgp/base.py
@@ -285,11 +285,12 @@ class Activity(object):
"""Stops all threads spawn by this activity.
"""
for thread_name, thread in list(self._child_thread_map.items()):
- if name is not None and thread_name is name:
- LOG.debug('%s: Stopping child thread %s',
- self.name, thread_name)
- thread.kill()
- self._child_thread_map.pop(thread_name, None)
+ if name is not None and thread_name != name:
+ continue
+ LOG.debug('%s: Stopping child thread %s',
+ self.name, thread_name)
+ thread.kill()
+ self._child_thread_map.pop(thread_name, None)
def _close_asso_sockets(self):
"""Closes all the sockets linked to this activity.
Could you try this?
Thanks,
Fujimoto
On 2018年04月05日 18:58, Jens Harbott wrote:
2018-04-05 0:12 GMT+00:00 Fujimoto Satoshi <satoshi.fujimo...@gmail.com>:
Hi, Jens
Could you check whether you have reinstalled Ryu after applying the patch.
# At Ryu top directory:
$ python setup.py install
I did patch the installed version, but forgot to remove the matching
.pyc file, so your patch was indeed not used, sorry for that. The
situation when the BGP session is not established is still the same.
When the session is established at shutdown time, I'm now seeing
slightly different tracebacks:
Shutting down
('Peer down:', '10.42.0.4', 65001)
hub: uncaught exception: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line
59, in _launch
return func(*args, **kwargs)
File
"/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/peer.py",
line 1305, in _connect_loop
password=password)
File
"/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/base.py",
line 437, in _connect_tcp
self._spawn(conn_name, conn_handler, sock)
File
"/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/base.py",
line 219, in _spawn
self._validate_callable(callable_)
File
"/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/base.py",
line 215, in _validate_callable
raise ActivityException(desc='Tried to spawn a child thread '
ActivityException: 100.1 - Tried to spawn a child thread before this
Activity was started.
Sent notification to ('10.42.0.12', '51898') >>
BGPNotification(data='',error_code=4,error_subcode=1,len=21,type=3)
hub: uncaught exception: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line
80, in _launch
return func(*args, **kwargs)
File
"/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/utils/evtlet.py",
line 63, in __call__
self._funct(*self._args, **self._kwargs)
File
"/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/speaker.py",
line 545, in _expired
self.stop()
File
"/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/speaker.py",
line 405, in stop
Activity.stop(self)
File
"/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/base.py",
line 314, in stop
raise ActivityException(desc='Cannot call stop when activity is '
ActivityException: 100.1 - Cannot call stop when activity is not
started or has been stopped already.
Yours,
Jens
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel