From: Kyr Shatskyy Date: Wed, 24 Jun 2020 09:27:31 +0000 (+0200) Subject: worker: fix crash on try_delete_jobs X-Git-Tag: 1.1.0~78^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1524%2Fhead;p=teuthology.git worker: fix crash on try_delete_jobs In some circumstances workers try to delete a job which is not created yet. It quits immediately with unhandled exception error. We do not want to allow crashes whatever error happens, because worker can continue working and process other jobs correctly. Also some schedulers might not add corresponding first in suite and last in suite jobs to the reporter, since it is not required. Signed-off-by: Kyr Shatskyy --- diff --git a/teuthology/worker.py b/teuthology/worker.py index e8d431f2e..e7c1eb6ef 100644 --- a/teuthology/worker.py +++ b/teuthology/worker.py @@ -192,7 +192,11 @@ def run_job(job_config, teuth_bin_path, archive_dir, verbose): safe_archive = safepath.munge(job_config['name']) if job_config.get('first_in_suite') or job_config.get('last_in_suite'): if teuth_config.results_server: - report.try_delete_jobs(job_config['name'], job_config['job_id']) + try: + report.try_delete_jobs(job_config['name'], job_config['job_id']) + except Exception as e: + log.warning("Unable to delete job %s, exception occurred: %s", + job_config['job_id'], e) suite_archive_dir = os.path.join(archive_dir, safe_archive) safepath.makedirs('/', suite_archive_dir) args = [