From b85e8303347b4ff16951e55e2be2d9b2d39d9678 Mon Sep 17 00:00:00 2001 From: Haiwei Xu Date: Thu, 7 Mar 2013 10:37:14 +0900 Subject: Keep exc_info() to prevent an internal error Fixes bug 1135539 When SysLogHandler is configured in UDP socket mode, the user who doesn't have the admin privilege got the unexpecting internal server error(HTTP 500) in "nova dns-create-private-domain" command. This bug occurs as the call graph drew below: |--ProxyCallback._process_data():amqp.py |--LOG.exception() | : | |--BaseHub.switch():hub.py | |-- clear_sys_exc_info() | |--ctxt.reply(None, sys.exc_info(),..) | : | |--serialize_remote_exception():common.py |--failure_info#(None,None,None) The sys.exc_info() is cleared by the clear_sys_exc_info(), but it is called again by the ctxt.reply(). This patch prevents the internal error and returns the details of the forbidden error(HTTP 403) which is expected. Change-Id: I549b4b2365c53c401edc80bbe30bcde249d27b85 --- openstack/common/rpc/amqp.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'openstack') diff --git a/openstack/common/rpc/amqp.py b/openstack/common/rpc/amqp.py index 128c7d7..2dcb12b 100644 --- a/openstack/common/rpc/amqp.py +++ b/openstack/common/rpc/amqp.py @@ -443,9 +443,11 @@ class ProxyCallback(_ThreadPoolWithWait): connection_pool=self.connection_pool, log_failure=False) except Exception: - LOG.exception(_('Exception during message handling')) - ctxt.reply(None, sys.exc_info(), - connection_pool=self.connection_pool) + # sys.exc_info() is deleted by LOG.exception(). + exc_info = sys.exc_info() + LOG.error(_('Exception during message handling'), + exc_info=exc_info) + ctxt.reply(None, exc_info, connection_pool=self.connection_pool) class MulticallProxyWaiter(object): -- cgit