summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2012-04-25 17:34:53 +0000
committerChris Behrens <cbehrens@codestud.com>2012-04-25 17:34:53 +0000
commit208c635a7d064fafc14dab97172c98cd5d8e6fc6 (patch)
tree6870c92c38aa3df1bed9a35c4659a8b9eeb190ff
parent587fee84ebd6ac042582ccc03a132c7f16043704 (diff)
Don't leak RPC connections on timeouts or other exceptions
Fixes bug 968843 Change-Id: I9e0f1e306cab203bf4c865050b7a45f96127062e
-rw-r--r--nova/rpc/amqp.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/nova/rpc/amqp.py b/nova/rpc/amqp.py
index cfa4ad1c1..ac29a625d 100644
--- a/nova/rpc/amqp.py
+++ b/nova/rpc/amqp.py
@@ -38,6 +38,7 @@ from nova import flags
from nova import log as logging
from nova.openstack.common import local
import nova.rpc.common as rpc_common
+from nova import utils
LOG = logging.getLogger(__name__)
@@ -293,7 +294,11 @@ class MulticallWaiter(object):
if self._done:
raise StopIteration
while True:
- self._iterator.next()
+ try:
+ self._iterator.next()
+ except Exception:
+ with utils.save_and_reraise_exception():
+ self.done()
if self._got_ending:
self.done()
raise StopIteration