]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Change rpc cleanup to occur before killing engine thread
authorJeff Peeler <jpeeler@redhat.com>
Sat, 15 Sep 2012 01:52:15 +0000 (21:52 -0400)
committerJeff Peeler <jpeeler@redhat.com>
Sat, 15 Sep 2012 02:07:13 +0000 (22:07 -0400)
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 <jpeeler@redhat.com>
heat/service.py

index 41c7a23b9551f90838ef25c426cb17389af8cc2e..4ea5ba0d2db80bc2c5d1f89d5b95cd58472a8041 100644 (file)
@@ -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()