summaryrefslogtreecommitdiff
path: root/masakari/service.py
diff options
context:
space:
mode:
Diffstat (limited to 'masakari/service.py')
-rw-r--r--masakari/service.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/masakari/service.py b/masakari/service.py
index ba5168f..949a105 100644
--- a/masakari/service.py
+++ b/masakari/service.py
@@ -41,6 +41,17 @@ LOG = logging.getLogger(__name__)
41CONF = masakari.conf.CONF 41CONF = masakari.conf.CONF
42 42
43 43
44def assert_eventlet_uses_monotonic_clock():
45 import eventlet.hubs as hubs
46 import monotonic
47
48 hub = hubs.get_hub()
49 if hub.clock is not monotonic.monotonic:
50 raise RuntimeError(
51 'eventlet hub is not using a monotonic clock - '
52 'periodic tasks will be affected by drifts of system time.')
53
54
44class Service(service.Service): 55class Service(service.Service):
45 """Service object for binaries running on hosts. 56 """Service object for binaries running on hosts.
46 57
@@ -78,6 +89,7 @@ class Service(service.Service):
78 } 89 }
79 90
80 def start(self): 91 def start(self):
92 assert_eventlet_uses_monotonic_clock()
81 verstr = version.version_string_with_package() 93 verstr = version.version_string_with_package()
82 LOG.info('Starting %(topic)s (version %(version)s)', { 94 LOG.info('Starting %(topic)s (version %(version)s)', {
83 'topic': self.topic, 95 'topic': self.topic,