]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix max_job_time timeout
authorZack Cerza <zack@cerza.org>
Mon, 17 Mar 2014 16:19:02 +0000 (11:19 -0500)
committerZack Cerza <zack@cerza.org>
Mon, 17 Mar 2014 16:19:02 +0000 (11:19 -0500)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/queue.py

index aad21e6c7aed17f30282f06bae3023093ff56c23..3ce3c0c403970d58325a25d29d6f081a99c432d5 100644 (file)
@@ -226,13 +226,13 @@ def run_with_watchdog(process, job_config):
     symlink_worker_log(job_config['worker_log'], job_config['archive_path'])
     while process.poll() is None:
         # Kill jobs that have been running longer than the global max
-        job_run_time = datetime.utcnow() - job_start_time
-        if job_run_time.seconds > teuth_config.max_job_time:
+        run_time = datetime.utcnow() - job_start_time
+        total_seconds = run_time.days * 60 * 60 * 24 + run_time.seconds
+        if total_seconds > teuth_config.max_job_time:
             log.warning("Job ran longer than {max}s. Killing...".format(
                 max=teuth_config.max_job_time))
             kill_job(job_info['name'], job_info['job_id'],
                      teuth_config.archive_base)
-            break
 
         report.try_push_job_info(job_info, dict(status='running'))
         time.sleep(teuth_config.watchdog_interval)