Skip to content

Commit

Permalink
Merge pull request #7701 from fstagni/80_updateLastUpdateTime_Matched
Browse files Browse the repository at this point in the history
[8.0] JobDB: update LastUpdateTime when the job is matched
  • Loading branch information
fstagni authored Jun 27, 2024
2 parents 14a37c5 + 9125b4b commit 2c4c947
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/DIRAC/Core/Utilities/TimeUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@
if a give datetime is in the defined interval.
"""
import calendar
import time
import datetime
import sys
import time

from DIRAC import gLogger


# Some useful constants for time operations
microsecond = datetime.timedelta(microseconds=1)
second = datetime.timedelta(seconds=1)
Expand Down
12 changes: 6 additions & 6 deletions src/DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
import concurrent.futures
import datetime

from DIRAC import S_OK, S_ERROR, gConfig
from DIRAC import S_ERROR, S_OK, gConfig
from DIRAC.AccountingSystem.Client.Types.Job import Job
from DIRAC.ConfigurationSystem.Client.Helpers import cfgPath
from DIRAC.ConfigurationSystem.Client.PathFinder import getSystemInstance
from DIRAC.Core.Base.AgentModule import AgentModule
from DIRAC.Core.Utilities import DErrno
from DIRAC.Core.Utilities.TimeUtilities import fromString, toEpoch, second
from DIRAC.Core.Utilities.ClassAd.ClassAdLight import ClassAd
from DIRAC.ConfigurationSystem.Client.Helpers import cfgPath
from DIRAC.ConfigurationSystem.Client.PathFinder import getSystemInstance
from DIRAC.WorkloadManagementSystem.Client.WMSClient import WMSClient
from DIRAC.Core.Utilities.TimeUtilities import fromString, second, toEpoch
from DIRAC.WorkloadManagementSystem.Client import JobMinorStatus, JobStatus
from DIRAC.WorkloadManagementSystem.Client.JobMonitoringClient import JobMonitoringClient
from DIRAC.WorkloadManagementSystem.Client.PilotManagerClient import PilotManagerClient
from DIRAC.WorkloadManagementSystem.Client.WMSClient import WMSClient
from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB
from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB import JobLoggingDB
from DIRAC.WorkloadManagementSystem.Client import JobStatus, JobMinorStatus


class StalledJobAgent(AgentModule):
Expand Down
2 changes: 1 addition & 1 deletion src/DIRAC/WorkloadManagementSystem/Client/Matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _reportStatus(self, resourceDict, jobID):
"""
attNames = ["Status", "MinorStatus", "ApplicationStatus", "Site"]
attValues = ["Matched", "Assigned", "Unknown", resourceDict["Site"]]
result = self.jobDB.setJobAttributes(jobID, attNames, attValues)
result = self.jobDB.setJobAttributes(jobID, attNames, attValues, update=True)
if not result["OK"]:
self.log.error("Problem reporting job status", f"setJobAttributes, jobID = {jobID}: {result['Message']}")
else:
Expand Down

0 comments on commit 2c4c947

Please sign in to comment.