Skip to content

Commit 7a3f526

Browse files
LinaresToineToine
authored andcommitted
Looking for JobCreator bug
1 parent 7847aac commit 7a3f526

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

src/python/WMComponent/JobCreator/JobCreatorPoller.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,15 @@ def pollSubscriptions(self):
412412
"""
413413
logging.info("Beginning JobCreator.pollSubscriptions() cycle.")
414414
myThread = threading.currentThread()
415-
415+
logging.info('TEST: jobCreator.pollSubscriptions 1')
416416
# First, get list of Subscriptions
417417
subscriptions = self.subscriptionList.execute()
418-
418+
logging.info('TEST: jobCreator.pollSubscriptions 2')
419419
# Okay, now we have a list of subscriptions
420420
for subscriptionID in subscriptions:
421+
logging.info('TEST: jobCreator.pollSubscriptions 3. subscriptionID is {}'.format(subscriptionID))
421422
wmbsSubscription = Subscription(id=subscriptionID)
423+
logging.info('TEST: jobCreator.pollSubscriptions 4. Subscription is {}'.format(wmbsSubscription))
422424
try:
423425
wmbsSubscription.load()
424426
except IndexError:
@@ -431,8 +433,10 @@ def pollSubscriptions(self):
431433
continue
432434

433435
workflow = Workflow(id=wmbsSubscription["workflow"].id)
436+
logging.info('TEST: jobCreator.pollSubscriptions 5. workflow is {}'.format(workflow))
434437
workflow.load()
435438
wmbsSubscription['workflow'] = workflow
439+
logging.info('TEST: jobCreator.pollSubscriptions 6. wmbsSubscription is {}'.format(wmbsSubscription))
436440
wmWorkload = retrieveWMSpec(workflow=workflow)
437441

438442
if not workflow.task or not wmWorkload:

src/python/WMComponent/RetryManager/Modifier/BaseModifier.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def __init__(self, config):
2424
self.backupPath = "oldSandboxes/"
2525
self.sandboxPath = None
2626
self.config = config
27+
self.dataDict = {}
2728

2829
def loadPKL(self, pklFile):
2930
with open(pklFile, 'rb') as file:
@@ -33,11 +34,12 @@ def loadPKL(self, pklFile):
3334
def savePKL(self, pklFile, data):
3435
with open(pklFile, 'wb') as file:
3536
pickle.dump(data, file)
36-
37-
def loadJobPKL(self, pklFile):
38-
if self.data is None:
39-
self.job = load
40-
37+
38+
def getDataDict(self):
39+
return self.dataDict
40+
41+
def updateDataDict(self, key, value):
42+
self.dataDict[key] = value
4143

4244
def updateSandbox(self, jobPKL, workload): # Not using workload?
4345
date = datetime.datetime.now().strftime("%y%m%d%H%M%S")

src/python/WMComponent/RetryManager/Modifier/MemoryModifier.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222

2323
class MemoryModifier(BaseModifier):
24-
def __init__(self):
25-
self.taskMemory = {}
24+
2625
def changeSandbox(self, jobPKL, newMemory):
2726
"""
2827
_changeSandbox_
@@ -93,16 +92,19 @@ def changeMemory(self, job, settings):
9392

9493
newMemory = self.getNewMemory(jobPKL, settings)
9594
taskPath = self.getTaskPath(jobPKL)
95+
taskMemory = self.getDataDict()
96+
logging.info('CURRENT TASK is {}'.format(taskPath))
97+
logging.info('1. DICTIONARY is {}'.format(taskMemory))
9698

97-
if not taskPath in self.taskMemory:
98-
self.taskMemory[taskPath] = job['estimatedMemoryUsage']
99+
if not taskPath in taskMemory:
100+
self.updateDataDict(key=taskPath, value=job['estimatedMemoryUsage'])
99101

100102
self.changeJobPkl(pklFile, jobPKL, newMemory)
101103

102-
if self.taskMemory[taskPath] < newMemory:
104+
logging.info('2. DICTIONARY is {}'.format(taskMemory))
105+
if taskMemory[taskPath] < newMemory:
103106
self.changeMemoryForTask(taskPath, jobPKL, newMemory)
104-
self.taskMemory[taskPath] = newMemory
105-
107+
taskMemory[taskPath] = newMemory
106108
logging.info('Old maxPSS: %d. New maxPSS: %d', job['estimatedMemoryUsage'], newMemory)
107109

108110
def modifyJob(self, job):

0 commit comments

Comments
 (0)