From 98d7a1681d975f1476020991427ad3fc8364519c Mon Sep 17 00:00:00 2001 From: Janus Date: Thu, 12 Apr 2018 15:21:51 +0200 Subject: [PATCH] lnbase: fix shutdown when lnbase has exception in main_loop --- lib/lnbase.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/lnbase.py b/lib/lnbase.py index 60d129c4e..3dea367c2 100644 --- a/lib/lnbase.py +++ b/lib/lnbase.py @@ -349,6 +349,11 @@ class Peer(PrintError): msg = await self.read_message() self.process_message(msg) except: + # if the loop isn't stopped + # run_forever in network.py would not return, + # the asyncioThread would not die, + # and we would block on shutdown + asyncio.get_event_loop().stop() traceback.print_exc() # close socket self.print_error('closing lnbase')