Skip to content

Commit

Permalink
fix: JobState does not need to push JobParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Aug 30, 2024
1 parent 5395cf2 commit b1db301
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
10 changes: 1 addition & 9 deletions src/DIRAC/WorkloadManagementSystem/Client/JobState/JobState.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from DIRAC.WorkloadManagementSystem.Client.JobState.JobManifest import JobManifest
from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB
from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB import JobLoggingDB
from DIRAC.WorkloadManagementSystem.DB.JobParametersDB import JobParametersDB
from DIRAC.WorkloadManagementSystem.DB.TaskQueueDB import TaskQueueDB, multiValueDefFields, singleValueDefFields
from DIRAC.WorkloadManagementSystem.Service.JobPolicy import (
RIGHT_CHANGE_STATUS,
Expand All @@ -26,7 +25,6 @@ def reset(self):
self.jobDB = None
self.logDB = None
self.tqDB = None
self.jobParametersDB = None

__db = DBHold()

Expand All @@ -38,7 +36,6 @@ def checkDBAccess(cls):
JobState.__db.jobDB = JobDB()
JobState.__db.logDB = JobLoggingDB()
JobState.__db.tqDB = TaskQueueDB()
JobState.__db.jpDB = JobParametersDB()

def __init__(self, jid):
self.__jid = jid
Expand Down Expand Up @@ -103,7 +100,7 @@ def commitCache(self, initialState, cache, jobLog):
return S_OK(False)
gLogger.verbose(f"Job {self.__jid}: About to execute trace. Current state {initialState}")

data = {"att": [], "jobp": [], "optp": []}
data = {"att": [], "optp": []}
for key in cache:
for dk in data:
if key.find(f"{dk}.") == 0:
Expand All @@ -118,11 +115,6 @@ def commitCache(self, initialState, cache, jobLog):
if not result["OK"]:
return result

if data["jobp"]:
result = self.__retryFunction(5, JobState.__db.jpDB.setJobParameters, (self.__jid, data["jobp"]))
if not result["OK"]:
return result

for k, v in data["optp"]:
result = self.__retryFunction(5, JobState.__db.jobDB.setJobOptParameter, (self.__jid, k, v))
if not result["OK"]:
Expand Down
4 changes: 2 additions & 2 deletions src/DIRAC/WorkloadManagementSystem/DB/JobParametersDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def __init__(self, parentLogger=None):
try:
# Connecting to the ES cluster
super().__init__(self.fullname, self.index_name, parentLogger=parentLogger)
except Exception as ex:
RuntimeError("Can't connect to JobParameters index") from ex
except Exception:
RuntimeError("Can't connect to JobParameters index")
self.addIndexTemplate("elasticjobparametersdb", index_patterns=[f"{self.index_name}_*"], mapping=mapping)

def _indexName(self, jobID: int, vo: str) -> str:
Expand Down

0 comments on commit b1db301

Please sign in to comment.