From ef9aec1cb6ec0d5fae699f9bb1f0d042530de5de Mon Sep 17 00:00:00 2001 From: armando-migliaccio Date: Mon, 18 Nov 2013 16:10:48 -0800 Subject: Address infinite loop in nova compute when getting network info Move the refresh_cache decorator to get_instance_nw_info. In fact, _get_instance_nw_info is called by the decorator itself, potentially causing an infinite loop in case nw_info is not of the expected value. This is also inline with the method's purpose, as stated by the docstring. At the same time, ensure that delete_port_for_instance and allocate_for_instance continue to refresh the cache by using the decorated version. Also, add a couple of debug traces that are friendly to the developer. Partial-bug: 1235435 Related-bug: 1251792 Change-Id: I06f8634ea241d05ac8fbcc290adf0cb23829f3e4 (cherry picked from commit 2e520496c369a8ef646820ec068cc4416ab50eca) --- nova/network/api.py | 1 + 1 file changed, 1 insertion(+) (limited to 'nova/network/api.py') diff --git a/nova/network/api.py b/nova/network/api.py index a36a023167..cd3d6d08ee 100644 --- a/nova/network/api.py +++ b/nova/network/api.py @@ -68,6 +68,7 @@ def refresh_cache(f): def update_instance_cache_with_nw_info(api, context, instance, nw_info=None, update_cells=True): try: + LOG.debug(_('Updating cache with info: %s'), nw_info) if not isinstance(nw_info, network_model.NetworkInfo): nw_info = None if not nw_info: -- cgit v1.2.1