summaryrefslogtreecommitdiff
path: root/nova/manager.py
diff options
context:
space:
mode:
authorMichael Still <mikal@stillhq.com>2013-01-12 17:36:56 +1100
committerMichael Still <mikal@stillhq.com>2013-01-14 07:53:47 +1100
commitd0c5fe6be4d6b00c5947f4b2a37ca9f496941e8b (patch)
treeebd31550b026f845bb333a087ccf1e11180040b7 /nova/manager.py
parent59333ce9f3b012ad63a004d16534ad19e998d9a8 (diff)
downloadnova-d0c5fe6be4d6b00c5947f4b2a37ca9f496941e8b.tar.gz
Fix logic error in periodic task wait code.
I was calculating the time to wait for the next run of a periodic task incorrectly. Resolves bug 1098819. Change-Id: Ida60b69014aa06229111e58024e35268262f18fb
Diffstat (limited to 'nova/manager.py')
-rw-r--r--nova/manager.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/manager.py b/nova/manager.py
index cb15b776eb..7df63f719b 100644
--- a/nova/manager.py
+++ b/nova/manager.py
@@ -215,8 +215,9 @@ class Manager(base.Base):
if self._periodic_spacing[task_name] is None:
wait = 0
else:
- wait = time.time() - (self._periodic_last_run[task_name] +
- self._periodic_spacing[task_name])
+ due = (self._periodic_last_run[task_name] +
+ self._periodic_spacing[task_name])
+ wait = max(0, due - time.time())
if wait > 0.2:
if wait < idle_for:
idle_for = wait