'ceph_git_base_url': 'https://github.com/ceph/',
'lock_server': 'http://teuthology.front.sepia.ceph.com/locker/lock',
'verify_host_keys': True,
+ 'watchdog_interval': 600,
}
def __init__(self):
import beanstalkc
+from . import report
from . import safepath
from .config import config as teuth_config
from .misc import read_config
job.delete()
+def run_with_watchdog(process, job_config):
+ # Only push the information that's relevant to the watchdog, to save db
+ # load
+ job_info = dict(
+ name=job_config['name'],
+ job_id=job_config['job_id'],
+ )
+
+ while process.poll() is None:
+ report.try_push_job_info(job_info, dict(status='running'))
+ time.sleep(teuth_config.watchdog_interval)
+
+ # The job finished. We don't know the status, but if it was a pass or fail
+ # it will have already been reported to paddles. In that case paddles
+ # ignores the 'dead' status. If the job was killed, paddles will use the
+ # 'dead' status.
+ report.try_push_job_info(job_info, dict(status='dead'))
+
+
def run_job(job_config, teuth_bin_path):
arg = [
os.path.join(teuth_bin_path, 'teuthology'),
child = logging.getLogger(__name__ + '.child')
for line in p.stderr:
child.error(': %s', line.rstrip('\n'))
- p.wait()
+
+ if teuth_config.results_server:
+ run_with_watchdog(p, job_config)
+ else:
+ p.wait()
+
if p.returncode != 0:
log.error('Child exited with code %d', p.returncode)
else: