<div dir="ltr"><div><div><div><div>Hello everyone.<br><br></div>  wrt these bugs: <a href="https://bugs.launchpad.net/nova/+bug/1276203" target="_blank">https://bugs.launchpad.net/nova/+bug/1276203</a> <a href="https://bugs.launchpad.net/nova/+bug/1272830">https://bugs.launchpad.net/nova/+bug/1272830</a> - I'd just like to make sure that the approach I'm planning makes sense.<br>

<br></div>  To summarise: Currently there are a number of methods in compute/manager.py that use the @periodic_task decorator.  Some of them also do their own checks about how often they are called, and use a convention of polling period = 0 to disable the method by returning early (although this is sometimes implemented as <=0 [1] and sometimes as ==0 [2]).  In the decorator itself though, a polling period of 0 is used to mean "call this method any time any other period task is run" [3].  It's difficult to predict how often this might be, and it may not be at regular intervals.<br>

<br></div>  I'd like to make this more consistent and predictable.  My plan is to use the following:<br><br></div><div>  - Any positive integer: the method is called every <this many> seconds, best effort is made not to call it more or less often.<br>

</div><div>  - 0: the method will be called regularly at the default period.  Currently hard-coded to 60s [4] this could be made into a config option<br></div><div>  - Any negative integer: the method will not be called<br>

<br></div><div>  All this logic would be contained in the decorator so that the methods themselves can just get on with whatever business they have.  So far, I hope this isn't too contentious - just clean code.  Is there any case that I've missed?  The fix will necessarily be a breaking change.  So how do you suggest I approach that aspect?  As it's common code, should I actually be looking to make these changes in Oslo first then porting them in?<br>
<br></div><div>  Thanks,<br><br></div><div>Matthew Gilliard<br><br>[1] <a href="https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4702" target="_blank">https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4702</a><br>

[2] <a href="https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4702" target="_blank">https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4702</a><br>[3] <a href="https://github.com/openstack/nova/blob/master/nova/openstack/common/periodic_task.py#L144" target="_blank">https://github.com/openstack/nova/blob/master/nova/openstack/common/periodic_task.py#L144</a><br>

[4] <a href="https://github.com/openstack/nova/blob/master/nova/openstack/common/periodic_task.py#L39" target="_blank">https://github.com/openstack/nova/blob/master/nova/openstack/common/periodic_task.py#L39</a><br></div>
</div>