Skip to content

Commit b0d9276

Browse files
authored
Merge pull request #7098 from DIRACGridBot/cherry-pick-2-2c2fce92b-integration
[sweep:integration] Fix exceptions in StalledJobAgent
2 parents 10814d9 + d9d237b commit b0d9276

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def _updateJobStatus(self, job, status, minorStatus=None, force=False):
340340

341341
if not minorStatus: # Retain last minor status for stalled jobs
342342
result = self.jobDB.getJobAttributes(job, ["MinorStatus"])
343-
if result["OK"]:
343+
if result["OK"] and "MinorStatus" in result["Value"]:
344344
minorStatus = result["Value"]["MinorStatus"]
345345
else:
346346
self.log.error("Failed getting MinorStatus", "for job %d: %s" % (job, result["Message"]))
@@ -475,6 +475,8 @@ def _checkHeartBeat(self, jobID, jobDict):
475475
lastWallTime = value
476476
except ValueError:
477477
pass
478+
if isinstance(heartBeatTime, str):
479+
heartBeatTime = datetime.datetime.strptime(heartBeatTime, "%Y-%m-%d %H:%M:%S")
478480
if heartBeatTime > lastHeartBeatTime:
479481
lastHeartBeatTime = heartBeatTime
480482

0 commit comments

Comments
 (0)