From 137e3592223f5a4f4591cf30e1bc197b4058da8c Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Fri, 14 Sep 2012 21:52:15 -0400 Subject: [PATCH] Change rpc cleanup to occur before killing engine thread This bug only manifested itself after a heat request was made to the engine. Once a request was made a Qpid connection handler continued to wait in a select call, presumably for a subsequent request. Closing the connection immediately after detecting a keyboard interrupt and then terminating the thread yields a clean shutdown with no traceback. Closes #176 Change-Id: Ifdb82d33a6c52a004bbd6b08c564264f4140e800 Signed-off-by: Jeff Peeler --- heat/service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/heat/service.py b/heat/service.py index 41c7a23b95..4ea5ba0d2d 100644 --- a/heat/service.py +++ b/heat/service.py @@ -235,6 +235,7 @@ def wait(): LOG.debug('%(flag)s : %(flag_get)s' % locals()) try: _launcher.wait() + rpc.cleanup() except KeyboardInterrupt: + rpc.cleanup() _launcher.stop() - rpc.cleanup()