Skip to content

Commit c7c4a98

Browse files
author
Andrei Tsaregorodtsev
authored
Merge pull request #5624 from fstagni/v7r2-fixes72
[v7r2] fix: TransformationCleaningAgent 'deletes', do not 'remove' jobs
2 parents 54e3f3f + e6dcbb8 commit c7c4a98

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/DIRAC/TransformationSystem/Agent/TransformationCleaningAgent.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ def __removeRequests(self, requestIDs):
632632
return S_OK()
633633

634634
def __removeWMSTasks(self, transJobIDs):
635-
"""wipe out jobs and their requests from the system
635+
"""delete jobs (mark their status as "JobStatus.DELETED") and their requests from the system
636636
637637
:param self: self reference
638638
:param list trasnJobIDs: job IDs
@@ -654,26 +654,26 @@ 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.removeJob(jobList)
657+
res = self.wmsClient.deleteJob(jobList)
658658
if res["OK"]:
659-
self.log.info("Successfully removed jobs from WMS", "(n=%d)" % len(jobList))
659+
self.log.info("Successfully deleted jobs from WMS", "(n=%d)" % len(jobList))
660660
elif ("InvalidJobIDs" in res) and ("NonauthorizedJobIDs" not in res) and ("FailedJobIDs" not in res):
661661
self.log.info("Found jobs which did not exist in the WMS", "(n=%d)" % len(res["InvalidJobIDs"]))
662662
elif "NonauthorizedJobIDs" in res:
663663
self.log.error(
664-
"Failed to remove jobs because not authorized", "(n=%d)" % len(res["NonauthorizedJobIDs"])
664+
"Failed to delete jobs because not authorized", "(n=%d)" % len(res["NonauthorizedJobIDs"])
665665
)
666666
allRemove = False
667667
elif "FailedJobIDs" in res:
668-
self.log.error("Failed to remove jobs", "(n=%d)" % len(res["FailedJobIDs"]))
668+
self.log.error("Failed to delete jobs", "(n=%d)" % len(res["FailedJobIDs"]))
669669
allRemove = False
670670

671671
if not allRemove:
672-
return S_ERROR("Failed to remove all remnants from WMS")
673-
self.log.info("Successfully removed all tasks from the WMS")
672+
return S_ERROR("Failed to delete all remnants from WMS")
673+
self.log.info("Successfully deleted all tasks from the WMS")
674674

675675
if not jobIDs:
676-
self.log.info("JobIDs not present, unable to remove asociated requests.")
676+
self.log.info("JobIDs not present, unable to delete associated requests.")
677677
return S_OK()
678678

679679
failed = 0

src/DIRAC/WorkloadManagementSystem/Agent/JobCleaningAgent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
""" The Job Cleaning Agent controls removing jobs from the WMS in the end of their life cycle.
22
3-
This agent will take care of removing user jobs, while production jobs should be removed through the
3+
This agent will take care of:
4+
- removing all jobs that are in status JobStatus.DELETED
5+
- deleting (sets status=JobStatus.DELETED) user jobs. The deletion of production jobs should be done by
46
:mod:`~DIRAC.TransformationSystem.Agent.TransformationCleaningAgent`.
57
68
.. literalinclude:: ../ConfigTemplate.cfg

0 commit comments

Comments
 (0)