Ensure we reset pidfile age when the pidfile is read.  I had dropped the call 
to register_pidfile() from get_pidfile_info() in my previous change, but now I 
realize the purpose of it was to reset the pidfile age.

Signed-off-by: Steve Howard <[email protected]>

--- autotest/scheduler/drone_manager.py 2010-01-21 11:33:25.000000000 -0800
+++ autotest/scheduler/drone_manager.py 2010-01-21 15:02:15.000000000 -0800
@@ -524,7 +524,12 @@
         if pidfile_id not in self._registered_pidfile_info:
             logging.info('monitoring pidfile %s', pidfile_id)
             self._registered_pidfile_info[pidfile_id] = _PidfileInfo()
-        self._registered_pidfile_info[pidfile_id].age = 0
+        self._reset_pidfile_age(pidfile_id)
+
+
+    def _reset_pidfile_age(self, pidfile_id):
+        if pidfile_id in self._registered_pidfile_info:
+            self._registered_pidfile_info[pidfile_id].age = 0
 
 
     def unregister_pidfile(self, pidfile_id):
@@ -543,6 +548,7 @@
         use_second_read is True, use results that were read after the processes
         were checked, instead of before.
         """
+        self._reset_pidfile_age(pidfile_id)
         if use_second_read:
             pidfile_map = self._pidfiles_second_read
         else:
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to