Make Voltha/OFAgent Ctrl-C terminatable
Change-Id: I8d64b126d8d8d6f368d6cc236b2293fbcd108416
diff --git a/voltha/main.py b/voltha/main.py
index 1fb5d04..2262c94 100755
--- a/voltha/main.py
+++ b/voltha/main.py
@@ -343,6 +343,18 @@
for component in reversed(registry.iterate()):
yield component.stop()
+ import threading
+ self.log.info('THREADS:')
+ main_thread = threading.current_thread()
+ for t in threading.enumerate():
+ if t is main_thread:
+ continue
+ if not t.isDaemon():
+ continue
+ self.log.info('joining thread {} {}'.format(
+ t.getName(), "daemon" if t.isDaemon() else "not-daemon"))
+ t.join()
+
def start_reactor(self):
from twisted.internet import reactor
reactor.callWhenRunning(