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
Reviewed: https:/ /review. openstack. org/72684 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=2bfc7171c23 d0595aa7f868027 1778bc58cb28ba
Committed: https:/
Submitter: Jenkins
Branch: master
commit 2bfc7171c23d059 5aa7f8680271778 bc58cb28ba
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: Ia227f4c4e69ecf 361ab02d1d17a30 10303650104
*_interval is set to 0
DocImpact: Warns of upcoming change to behaviour when
Closes-Bug: #1272830
Partial-Bug: #1276203