Skip to content

Commit 22fadb6

Browse files
committed
fix (WMS): Exceptions in StalledJobAgent
1 parent 7c2134c commit 22fadb6

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
@@ -339,7 +339,7 @@ def _updateJobStatus(self, job, status, minorStatus=None, force=False):
339339

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

0 commit comments

Comments
 (0)