ci,crnm: warning message when a job can't be enabled
Instead of an exception that completely stops the run'n'monitor process, when a job with a specific status can't be enabled, just log it with a warning. Don't attempt to enable it again unless it changes the status. Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39049>
This commit is contained in:
committed by
Marge Bot
parent
a689ec8676
commit
467dd0b990
@@ -302,12 +302,18 @@ def enable_job(
|
||||
# Get current attempt number
|
||||
attempt_count = enable_attempts.get((job.id, job.status), 0)
|
||||
# Check if we've exceeded max attempts to avoid infinite loop
|
||||
if attempt_count >= MAX_ENABLE_JOB_ATTEMPTS:
|
||||
raise RuntimeError(
|
||||
if attempt_count == MAX_ENABLE_JOB_ATTEMPTS:
|
||||
print(
|
||||
f"[yellow]WARNING: "
|
||||
f"Maximum enabling attempts ({MAX_ENABLE_JOB_ATTEMPTS}) reached for job {job.name} in {job.status} status"
|
||||
f"({link2print(job.web_url, job.id)}). Giving up."
|
||||
f"({link2print(job.web_url, job.id)})."
|
||||
)
|
||||
enable_attempts[(job.id, job.status)] = attempt_count + 1
|
||||
return False
|
||||
elif attempt_count > MAX_ENABLE_JOB_ATTEMPTS:
|
||||
return False
|
||||
|
||||
enable_attempts[(job.id, job.status)] = attempt_count + 1
|
||||
|
||||
pjob = project.jobs.get(job.id, lazy=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user