Skip to content

Commit

Permalink
fix: use new version of __executeCondorCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
atsareg committed Feb 2, 2023
1 parent 129ca5f commit 7757f55
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/DIRAC/Resources/Computing/HTCondorCEComputingElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,24 +355,31 @@ def killJob(self, jobIDList):

self.log.verbose("KillJob jobIDList", jobIDList)

tokenFile = None
self.tokenFile = None

for jobRef in jobIDList:
job, _, jobID = condorIDAndPathToResultFromJobRef(jobRef)
self.log.verbose("Killing pilot", job)
cmd = ["condor_rm"]
cmd.extend(self.remoteScheddOptions.strip().split(" "))
cmd.append(jobID)
result = self._executeCondorCommand(cmd, tokenFile, keepTokenFile=True)
result = self._executeCondorCommand(cmd, keepTokenFile=True)
if not result["OK"]:
if self.tokenFile:
os.remove(self.tokenFile)
self.tokenFile = None
return S_ERROR(f"condor_rm failed completely: {result['Message']}")
status, stdout, stderr = result["Value"]
if status != 0:
self.log.warn("Failed to kill pilot", f"{job}: {stdout}, {stderr}")
if self.tokenFile:
os.remove(self.tokenFile)
self.tokenFile = None
return S_ERROR(f"Failed to kill pilot {job}: {stderr}")

if tokenFile:
os.remove(tokenFile)
if self.tokenFile:
os.remove(self.tokenFile)
self.tokenFile = None

return S_OK()

Expand Down

0 comments on commit 7757f55

Please sign in to comment.