summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJerry Cen <zhiweic@google.com>2015-06-15 14:27:46 -0700
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-06-18 16:31:31 +0900
commitce219b31b43a025e9a87173a16b11650ced59689 (patch)
treec46f960a82305044d398ab2328262bc8bb9fe169
parentd3e9f6b06d1b75b65f7a8cc03fb3fde8aa81728d (diff)
Clean up server socket and thread when shutting down
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/services/protocols/bgp/base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ryu/services/protocols/bgp/base.py b/ryu/services/protocols/bgp/base.py
index 94c2bc9d..aac0fe60 100644
--- a/ryu/services/protocols/bgp/base.py
+++ b/ryu/services/protocols/bgp/base.py
@@ -275,7 +275,7 @@ class Activity(object):
LOG.debug('%s: Stopping child thread %s',
self.name, thread_name)
thread.kill()
- del self._child_thread_map[thread_name]
+ self._child_thread_map.pop(thread_name, None)
def _close_asso_sockets(self):
"""Closes all the sockets linked to this activity.
@@ -375,11 +375,13 @@ class Activity(object):
server = None
for sa in listen_sockets.keys():
name = self.name + '_server@' + str(sa[0])
+ self._asso_socket_map[name] = listen_sockets[sa]
if count == 0:
import eventlet
server = eventlet.spawn(self._listen_socket_loop,
listen_sockets[sa], conn_handle)
+ self._child_thread_map[name] = server
count += 1
else:
server = self._spawn(name, self._listen_socket_loop,