Skip to content

Commit f48d3dd

Browse files
authored
Merge pull request #5670 from DIRACGridBot/cherry-pick-2-d6ba0970a-integration
[sweep:integration] Handle requests for killed jobs
2 parents af49cff + 5626b2b commit f48d3dd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/DIRAC/RequestManagementSystem/Client/ReqClient.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,13 @@ def finalizeRequest(self, requestID, jobID, useCertificates=True):
380380
newJobStatus = JobStatus.DONE
381381
elif jobMinorStatus == JobMinorStatus.APP_ERRORS:
382382
newJobStatus = JobStatus.FAILED
383+
elif jobMinorStatus == JobMinorStatus.MARKED_FOR_TERMINATION:
384+
# If the job has been Killed, set it Killed
385+
newJobStatus = JobStatus.KILLED
383386
else:
384-
self.log.error("finalizeRequest: Unexpected jobMinorStatus", "(got %s)" % jobMinorStatus)
387+
self.log.error(
388+
"finalizeRequest: Unexpected jobMinorStatus", "for %d (got %s)" % (jobID, jobMinorStatus)
389+
)
385390
return S_ERROR("Unexpected jobMinorStatus")
386391

387392
if newJobStatus:
@@ -598,8 +603,8 @@ def printRequest(request, status=None, full=False, verbose=True, terse=False):
598603
op = indexOperation[1]
599604
if not terse or op.Status == "Failed":
600605
printOperation(indexOperation, verbose, onlyFailed=terse)
601-
602-
printFTSJobs(request)
606+
if not terse:
607+
printFTSJobs(request)
603608

604609

605610
def printOperation(indexOperation, verbose=True, onlyFailed=False):

src/DIRAC/WorkloadManagementSystem/Client/JobMinorStatus.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
#
5151
JOB_WRAPPER_EXECUTION = "JobWrapper execution"
5252
#
53+
MARKED_FOR_TERMINATION = "Marked for termination"
54+
#
5355
RECEIVED_KILL_SIGNAL = "Received Kill signal"
5456
#
5557
RESOLVING_OUTPUT_SANDBOX = "Resolving Output Sandbox"

0 commit comments

Comments
 (0)