Skip to content

Commit 9bc116d

Browse files
committed
fix: use removeJob instead of deleteJob when needed
1 parent ca3e663 commit 9bc116d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/DIRAC/Interfaces/API/Dirac.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,8 +1651,9 @@ def getOutputSandbox(self, jobID, outputDir=None, oversized=True, noJobDir=False
16511651
#############################################################################
16521652

16531653
def deleteJob(self, jobID):
1654-
"""Delete job or list of jobs from the WMS, if running these jobs will
1655-
also be killed.
1654+
"""
1655+
Delete (set status=DELETED) to job or list of jobs from the WMS
1656+
If running, these jobs will be first killed.
16561657
16571658
Example Usage:
16581659

src/DIRAC/TransformationSystem/Agent/TransformationCleaningAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ def __removeWMSTasks(self, transJobIDs):
654654
self.log.error("Failed to kill jobs", "(n=%d)" % len(res["FailedJobIDs"]))
655655
allRemove = False
656656

657-
res = self.wmsClient.deleteJob(jobList)
657+
res = self.wmsClient.removeJob(jobList)
658658
if res["OK"]:
659659
self.log.info("Successfully removed jobs from WMS", "(n=%d)" % len(jobList))
660660
elif ("InvalidJobIDs" in res) and ("NonauthorizedJobIDs" not in res) and ("FailedJobIDs" not in res):

src/DIRAC/WorkloadManagementSystem/Client/WMSClient.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ def submitJob(self, jdl, jobDescriptionObject=None):
205205
break
206206
time.sleep(1)
207207
if not confirmed:
208-
# The bulk submission failed, try to delete the created jobs
209-
resultDelete = self.jobManager.deleteJob(jobIDList)
208+
# The bulk submission failed, try to remove the created jobs
209+
resultDelete = self.jobManager.removeJob(jobIDList)
210210
error = "Job submission failed to confirm bulk transaction"
211211
if not resultDelete["OK"]:
212212
error += "; removal of created jobs failed"

0 commit comments

Comments
 (0)