From 3628343efbaa1bb48042122e7a833519bb749b51 Mon Sep 17 00:00:00 2001 From: Chris Burr Date: Tue, 17 Sep 2024 10:11:21 +0200 Subject: [PATCH 1/2] fix: KILLED is a final job state --- src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py b/src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py index 28bc9a75a5e..e36513b13b1 100644 --- a/src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py +++ b/src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py @@ -64,7 +64,7 @@ ] # Job States when the payload work has finished -JOB_FINAL_STATES = [DONE, COMPLETED, FAILED] +JOB_FINAL_STATES = [DONE, COMPLETED, FAILED, KILLED] # WMS internal job States indicating the job object won't be updated JOB_REALLY_FINAL_STATES = [DELETED] From 3bf6577d8047edbb2b2fb15d0e075a5bc429b7c0 Mon Sep 17 00:00:00 2001 From: Chris Burr Date: Tue, 17 Sep 2024 10:20:42 +0200 Subject: [PATCH 2/2] fix: Support moving jobs to KILLED from more states --- src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py b/src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py index e36513b13b1..671a7829f82 100644 --- a/src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py +++ b/src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py @@ -89,14 +89,14 @@ def __init__(self, state): COMPLETING: State(10, [DONE, FAILED, COMPLETED, STALLED, KILLED], defState=COMPLETING), STALLED: State(9, [RUNNING, FAILED, KILLED], defState=STALLED), RUNNING: State(8, [STALLED, DONE, FAILED, RESCHEDULED, COMPLETING, KILLED, RECEIVED], defState=RUNNING), - RESCHEDULED: State(7, [WAITING, RECEIVED, DELETED, FAILED], defState=RESCHEDULED), + RESCHEDULED: State(7, [WAITING, RECEIVED, DELETED, FAILED, KILLED], defState=RESCHEDULED), MATCHED: State(6, [RUNNING, FAILED, RESCHEDULED, KILLED], defState=MATCHED), WAITING: State(5, [MATCHED, RESCHEDULED, DELETED, KILLED], defState=WAITING), STAGING: State(4, [CHECKING, WAITING, FAILED, KILLED], defState=STAGING), SCOUTING: State(3, [CHECKING, FAILED, STALLED, KILLED], defState=SCOUTING), - CHECKING: State(2, [SCOUTING, STAGING, WAITING, RESCHEDULED, FAILED, DELETED], defState=CHECKING), - RECEIVED: State(1, [SCOUTING, CHECKING, WAITING, FAILED, DELETED], defState=RECEIVED), - SUBMITTING: State(0, [RECEIVED, CHECKING, DELETED], defState=SUBMITTING), # initial state + CHECKING: State(2, [SCOUTING, STAGING, WAITING, RESCHEDULED, FAILED, DELETED, KILLED], defState=CHECKING), + RECEIVED: State(1, [SCOUTING, CHECKING, WAITING, FAILED, DELETED, KILLED], defState=RECEIVED), + SUBMITTING: State(0, [RECEIVED, CHECKING, DELETED, KILLED], defState=SUBMITTING), # initial state }