From 487a2adbfdb9100119f141dd2d6fb8ebc763e8b6 Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Mon, 11 Sep 2023 17:49:01 +0200 Subject: [PATCH] fix: do not try to insert nan values in AccountingDB --- .../JobWrapper/JobWrapper.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapper.py b/src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapper.py index cbe05527662..a4fb4ea8ec8 100755 --- a/src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapper.py +++ b/src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapper.py @@ -1276,8 +1276,16 @@ def sendJobAccounting(self, status="", minorStatus=""): self.log.info("EXECUTION_RESULT[CPU] in sendJobAccounting", cpuString) utime, stime, cutime, cstime, elapsed = EXECUTION_RESULT["CPU"] - cpuTime = utime + stime + cutime + cstime - execTime = elapsed + try: + cpuTime = int(utime + stime + cutime + cstime) + except ValueError: + cpuTime = 0 + + try: + execTime = int(elapsed) + except ValueError: + execTime = 0 + diskSpaceConsumed = getGlobbedTotalSize(os.path.join(self.root, str(self.jobID))) # Fill the data acData = {