Skip to content

Commit f0959cf

Browse files
committed
feat(DM01-5915): upload archive files on job timeout
1 parent dc34cfe commit f0959cf

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/scheduler/kubernetes/scheduler.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,12 @@ def handle_timeouts(self):
926926
WHERE id = %s and state = 'running' """, (job_id,))
927927
cursor.close()
928928

929+
# Delete the k8s resource so the pod receives SIGTERM and has
930+
# terminationGracePeriodSeconds (60s) to run finalize_upload(),
931+
# which uploads /infrabox/upload/archive. kube_delete_job is
932+
# idempotent — safe if the resource is already being deleted.
933+
self.kube_delete_job(job_id)
934+
929935
def upload_console(self, job_id):
930936
cursor = self.conn.cursor()
931937
cursor.execute("begin")

0 commit comments

Comments
 (0)