Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PM-1726 retry and exit using statuses #57

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions uptime_service_validation/coordinator/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,17 @@ def setUpValidatorPods(time_intervals, logging, worker_image, worker_tag):
if job_status.status.succeeded:
logging.info(f"Job {job_name} succeeded.")
jobs.remove(job_name)
elif job_status.status.failed:
logging.error(f"Job {job_name} failed.")
jobs.remove(job_name)
elif job_status.status.failed is not None:
if job_status.status.failed < Config.RETRY_COUNT:
logging.warning(
f"Job {job_name} failed. Retrying attempt {job_status.status.failed}/{Config.RETRY_COUNT}..."
)
else:
logging.error(
f"Job {job_name} failed. Maximum retries ({Config.RETRY_COUNT}) reached. Exiting the program..."
)
jobs.remove(job_name)
exit(1)
except Exception as e:
logging.error(f"Error reading job status for {job_name}: {e}")

Expand Down
Loading