Skip to content

Commit 833b562

Browse files
committed
leave the CR deletion to the reconcile loop
1 parent 4ca01f9 commit 833b562

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

src/scheduler/kubernetes/scheduler.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,6 @@ def handle_aborts(self):
809809
job_id = abort[0]
810810
user_id = abort[1]
811811

812-
self.kube_delete_job(job_id)
813812
self.upload_console(job_id)
814813

815814
if user_id:
@@ -832,16 +831,9 @@ def handle_aborts(self):
832831
SET state = 'killed',
833832
end_date = current_timestamp,
834833
message = %s
835-
WHERE id = %s AND state IN ('scheduled', 'running', 'queued')
836-
""", [message, job_id])
837-
cursor.close()
838-
839-
# Forget abort
840-
cursor = self.conn.cursor()
841-
cursor.execute('''
842-
DELETE FROM "abort"
843-
WHERE job_id = %s
844-
''', [job_id])
834+
WHERE id = %s AND state IN ('scheduled', 'running', 'queued');
835+
DELETE FROM "abort" WHERE job_id = %s
836+
""", [message, job_id, job_id])
845837
cursor.close()
846838

847839
def handle_timeouts(self):
@@ -861,7 +853,6 @@ def handle_timeouts(self):
861853

862854
for abort in aborts:
863855
job_id = abort[0]
864-
self.kube_delete_job(job_id)
865856
self.upload_console(job_id)
866857

867858
# Update state

0 commit comments

Comments
 (0)