Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 900c503

Browse files
Handle previously failed indexing jobs (#206)
Co-authored-by: Josh Bradley <[email protected]>
1 parent c7b5f96 commit 900c503

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

backend/indexing-job-manager-template.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ spec:
1212
schedule: "*/5 * * * *"
1313
jobTemplate:
1414
spec:
15-
ttlSecondsAfterFinished: 30
1615
template:
1716
metadata:
1817
labels:

backend/indexing-job-template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ spec:
2626
imagePullPolicy: Always
2727
resources:
2828
requests:
29-
cpu: "6"
30-
memory: "56Gi"
29+
cpu: "5"
30+
memory: "36Gi"
3131
limits:
3232
cpu: "8"
3333
memory: "64Gi"

backend/manage-indexing-jobs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ def list_k8s_jobs(namespace: str) -> list[str]:
8888
jobs = batch_v1.list_namespaced_job(namespace=namespace)
8989
job_list = []
9090
for job in jobs.items:
91-
job_list.append(job.metadata.name)
91+
if job.metadata.name.startswith("indexing-job-") and job.status.active:
92+
job_list.append(job.metadata.name)
9293
return job_list
9394

9495

@@ -124,7 +125,7 @@ def main():
124125
)
125126
pipelinejob = PipelineJob()
126127
pipeline_job = pipelinejob.load_item(item["sanitized_index_name"])
127-
pipeline_job["status"] = PipelineJobState.FAILED.value
128+
pipeline_job.status = PipelineJobState.FAILED
128129
else:
129130
print(
130131
f"Indexing job for '{item['human_readable_index_name']}' already running. Will not schedule another. Exiting..."

0 commit comments

Comments
 (0)