Comment 1 for bug 1510234

Revision history for this message
Diana Clarke (diana-clarke) wrote :

Someone suggested that I try the following approach.

diff --git a/nova/service.py b/nova/service.py
index a09187d..396bf30 100644
--- a/nova/service.py
+++ b/nova/service.py
@@ -21,6 +21,9 @@ import os
 import random
 import sys

+import eventlet
+import monotonic
+
 from oslo_concurrency import processutils
 from oslo_config import cfg
 from oslo_log import log as logging
@@ -139,6 +142,10 @@ class Service(service.Service):
                  periodic_interval_max=None, db_allowed=True,
                  *args, **kwargs):
         super(Service, self).__init__()
+
+ hub = eventlet.hubs.get_hub()
+ hub.clock = monotonic.monotonic
+
         self.host = host
         self.binary = binary
         self.topic = topic

After applying the above patch, all services except nova-conductor use monotonic for the clock in loopingcall. The nova-conductor service isn't working because it continues to use the bulit-in time, and sleeps in loopingcall until the actual time catches up to the future time. I'm not sure why the nova-conductor service continues to use the built-in time after the patch. Does anyone else know?

    http://paste.openstack.org/show/477406/

Thoughts on this approach or other approaches?

Thanks!