]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
task: mon_clock_skew_check: mark as ran once if an expected skew was found
authorJoao Eduardo Luis <jecluis@gmail.com>
Wed, 30 Jan 2013 20:52:03 +0000 (20:52 +0000)
committerJoao Eduardo Luis <jecluis@gmail.com>
Wed, 30 Jan 2013 20:52:03 +0000 (20:52 +0000)
... even if we didn't get a clean/finished result from the monitors

This ought to significantly cut the waiting time if something else (or
someone else) is leaving the leader hanging thus unable to finish a given
timecheck round.

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
teuthology/task/mon_clock_skew_check.py

index e45c6528e5638f6c4d39d6bec1a382ed17518f97..c48efd9c4dbf6c443a033bfaf572232079bf8d39 100644 (file)
@@ -84,6 +84,16 @@ class ClockSkewCheck:
         s=self.check_interval))
       time.sleep(self.check_interval)
 
+  def print_skews(self, skews):
+    total = len(skews)
+    if total > 0:
+      self.info('---------- found {n} skews ----------'.format(n=total))
+      for mon_id,values in skews.iteritems():
+        self.info('mon.{id}: {v}'.format(id=mon_id,v=values))
+      self.info('-------------------------------------')
+    else:
+      self.info('---------- no skews were found ----------')
+
   def do_check(self):
     self.info('start checking for clock skews')
     skews = dict()
@@ -151,18 +161,13 @@ class ClockSkewCheck:
           else:
             self.warn('unexpected skew: {str}'.format(str=log_str))
 
-      if clean_check:
+      if clean_check or (self.expect_skew and len(skews) > 0):
         ran_once = True
+        self.print_skews(skews)
       self.sleep_interval()
 
     total = len(skews)
-    if total > 0:
-      self.info('---------- found {n} skews ----------'.format(n=total))
-      for mon_id,values in skews.iteritems():
-        self.info('mon.{id}: {v}'.format(id=mon_id,v=values))
-      self.info('-------------------------------------')
-    else:
-      self.info('---------- no skews were found ----------')
+    self.print_skews(skews)
 
     error_str = ''
     found_error = False