]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
worker: fix crash on try_delete_jobs 1524/head
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Wed, 24 Jun 2020 09:27:31 +0000 (11:27 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Wed, 24 Jun 2020 14:27:51 +0000 (16:27 +0200)
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 <kyrylo.shatskyy@suse.com>
teuthology/worker.py

index e8d431f2e60117e2d93d5eeef058076fb1ce880a..e7c1eb6ef7a8114c32fded41324f0fec8627de79 100644 (file)
@@ -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 = [