heal_instance_info_cache_interval config is not effective

Bug #1274317 reported by Weiwen Chen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Matthew Gilliard

Bug Description

There is configuration item in /etc/nova/nova.conf that controls how often the instance info should be updated. By default the value is 60 seconds. However, the current implementation only uses that value to prevent over clocked. Configure it to a different value in nova.conf does not has impact how often the task is executed.

If I change the code in /usr/lib/python2.6/site-packages/nova/compute/manager.py with the spacing parameter, the configured value will be in action. Please fix this bug.

@periodic_task.periodic_task(spacing=CONF.heal_instance_info_cache_interval)
    def _heal_instance_info_cache(self, context):

Tags: compute
Matt Riedemann (mriedem)
tags: added: compute
Phil Day (philip-day)
Changed in nova:
assignee: nobody → Phil Day (philip-day)
assignee: Phil Day (philip-day) → nobody
Phil Day (philip-day)
Changed in nova:
assignee: nobody → Phil Day (philip-day)
Revision history for this message
Phil Day (philip-day) wrote :

The current code does attempt to correctly only refresh the cache at the configured interval, by checking if the configured time has elapsed since the last time it ran:

https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4482-L4485

However this assumes that the period task itself will be called at least as frequently as heal_instance_info_cache_interval.

The overall period task scheduler runs at the interval set by min(DEFAULT_INTERVAL=60, <any intervals declared by decorators)

https://github.com/openstack/nova/blob/master/nova/openstack/common/periodic_task.py#L175
https://github.com/openstack/nova/blob/master/nova/openstack/common/periodic_task.py#L190

Since _heal_instance_info_cache() doesn't pass an interval into its periodic_task decorator it has no direct control over how often it will be called - and hence it can be called more frequently than the minimum interval set by another period task.

Currently only the following period tasks pass their required polling interval into the decorator:

_poll_shelved_instances
_sync_power_states
_cleanup_running_deleted_instances
_run_image_cache_manager_pass
_run_pending_deletes

Changed in nova:
assignee: Phil Day (philip-day) → Matthew Gilliard (matthew-gilliard-u)
Changed in nova:
status: New → In Progress
Changed in nova:
status: In Progress → Fix Released
Dan Smith (danms)
Changed in nova:
milestone: none → icehouse-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/70954
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=70f7761e6f053297266fd5cc63212e74e73ec1cc
Submitter: Jenkins
Branch: master

commit 70f7761e6f053297266fd5cc63212e74e73ec1cc
Author: Matthew Gilliard <email address hidden>
Date: Tue Feb 4 10:59:34 2014 +0000

    Specify spacing on periodic_tasks in manager.py

    Some methods in compute/manager.py were using the @periodic_task
    decorator to ensure they were called regularly, but were not passing
    in the `spacing` kwarg. In this case the method can only be called at
    the default rate, calculated as min(60 seconds, <spacings from all
    periodic_tasks>), regardless of the poll interval set in config.

    Although there was throttling code which prevented the methods from
    executing too often, the case where we do want the method to execute
    very often was missed. This patch ensures that setting the config
    values low will cause the method to be called as frequently.

    Change-Id: I1530c8b3b6ac71f4d9e2e41188c0eca4a6556e01
    Closes-Bug: #1274317

Revision history for this message
Thierry Carrez (ttx) wrote :

Keep FixCommitted until RC1 is tagged

Changed in nova:
status: Fix Released → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-rc1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.