From: Zack Cerza Date: Mon, 3 Apr 2023 22:07:37 +0000 (-0600) Subject: worker.prep_job: Skip job if ls_remote fails X-Git-Tag: 1.2.0~112^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1af61263df86ef2e710e4eba9d6eb9b358f276a0;p=teuthology.git worker.prep_job: Skip job if ls_remote fails This is preferable to letting the dispatcher die. Signed-off-by: Zack Cerza --- diff --git a/teuthology/worker.py b/teuthology/worker.py index b23b6120a5..2e5a57c543 100644 --- a/teuthology/worker.py +++ b/teuthology/worker.py @@ -156,7 +156,15 @@ def prep_job(job_config, log_file_path, archive_dir): teuthology_sha1 = job_config.get('teuthology_sha1') if not teuthology_sha1: repo_url = repo_utils.build_git_url('teuthology', 'ceph') - teuthology_sha1 = repo_utils.ls_remote(repo_url, teuthology_branch) + try: + teuthology_sha1 = repo_utils.ls_remote(repo_url, teuthology_branch) + except Exception as exc: + log.exception(f"Could not get teuthology sha1 for branch {teuthology_branch}") + report.try_push_job_info( + job_config, + dict(status='dead', failure_reason=str(exc)) + ) + raise SkipJob() if not teuthology_sha1: reason = "Teuthology branch {} not found; marking job as dead".format(teuthology_branch) log.error(reason)