Comment 2 for bug 1272830

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/72684
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2bfc7171c23d0595aa7f8680271778bc58cb28ba
Submitter: Jenkins
Branch: master

commit 2bfc7171c23d0595aa7f8680271778bc58cb28ba
Author: Matthew Gilliard <email address hidden>
Date: Tue Feb 11 15:28:40 2014 +0000

    Add warning to periodic_task with interval 0

    The behaviour of Oslo's @periodic_task decorator is that
    a repeat interval of 0 means that the method will be
    called regularly. Several Nova methods which use that
    decorator also have code for returning early (ie no-op)
    if the interval is 0. This is inconsistent for users, and
    means there is timing-related code where it doesn't belong.

    This patch adds a warning when a user takes a value of 0
    from config and uses it as an interval in a @periodic_task.

    Ideally all code will use Oslo's convention that 0 means
    run at the default rate and a negative interval will mean
    "don't run". After this warning has been in place for a full
    release cycle that can be the case.

    Change-Id: Ia227f4c4e69ecf361ab02d1d17a3010303650104
    DocImpact: Warns of upcoming change to behaviour when
               *_interval is set to 0
    Closes-Bug: #1272830
    Partial-Bug: #1276203