mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
catch exceptions in getContainerByIdGen, called by CheckContainers.run
This commit is contained in:
parent
375ea545a8
commit
ddf3b5c518
@ -554,8 +554,13 @@ class CheckContainers(Job):
|
|||||||
name = self._leakDetector.getContainerNameById(id)
|
name = self._leakDetector.getContainerNameById(id)
|
||||||
if idx2id2len[self._index-1][id] != 0:
|
if idx2id2len[self._index-1][id] != 0:
|
||||||
percent = 100. * (float(diff) / float(idx2id2len[self._index-1][id]))
|
percent = 100. * (float(diff) / float(idx2id2len[self._index-1][id]))
|
||||||
|
try:
|
||||||
for container in self._leakDetector.getContainerByIdGen(id):
|
for container in self._leakDetector.getContainerByIdGen(id):
|
||||||
yield None
|
yield None
|
||||||
|
except:
|
||||||
|
# TODO
|
||||||
|
self.notify.debug('caught exception in getContainerByIdGen (1)')
|
||||||
|
else:
|
||||||
self.notify.warning(
|
self.notify.warning(
|
||||||
'%s (%s) grew %.2f%% in %.2f minutes (%s items at last measurement, current contents: %s)' % (
|
'%s (%s) grew %.2f%% in %.2f minutes (%s items at last measurement, current contents: %s)' % (
|
||||||
name, itype(container), percent, minutes, idx2id2len[self._index][id],
|
name, itype(container), percent, minutes, idx2id2len[self._index][id],
|
||||||
@ -569,8 +574,13 @@ class CheckContainers(Job):
|
|||||||
if self._index <= 4:
|
if self._index <= 4:
|
||||||
if diff > 0 and diff2 > 0 and diff3 > 0:
|
if diff > 0 and diff2 > 0 and diff3 > 0:
|
||||||
name = self._leakDetector.getContainerNameById(id)
|
name = self._leakDetector.getContainerNameById(id)
|
||||||
|
try:
|
||||||
for container in self._leakDetector.getContainerByIdGen(id):
|
for container in self._leakDetector.getContainerByIdGen(id):
|
||||||
yield None
|
yield None
|
||||||
|
except:
|
||||||
|
# TODO
|
||||||
|
self.notify.debug('caught exception in getContainerByIdGen (2)')
|
||||||
|
else:
|
||||||
msg = ('%s (%s) consistently increased in size over the last '
|
msg = ('%s (%s) consistently increased in size over the last '
|
||||||
'3 periods (%s items at last measurement, current contents: %s)' %
|
'3 periods (%s items at last measurement, current contents: %s)' %
|
||||||
(name, itype(container), idx2id2len[self._index][id],
|
(name, itype(container), idx2id2len[self._index][id],
|
||||||
@ -585,8 +595,13 @@ class CheckContainers(Job):
|
|||||||
diff5 = idx2id2len[self._index-4][id] - idx2id2len[self._index-5][id]
|
diff5 = idx2id2len[self._index-4][id] - idx2id2len[self._index-5][id]
|
||||||
if diff > 0 and diff2 > 0 and diff3 > 0 and diff4 > 0 and diff5 > 0:
|
if diff > 0 and diff2 > 0 and diff3 > 0 and diff4 > 0 and diff5 > 0:
|
||||||
name = self._leakDetector.getContainerNameById(id)
|
name = self._leakDetector.getContainerNameById(id)
|
||||||
|
try:
|
||||||
for container in self._leakDetector.getContainerByIdGen(id):
|
for container in self._leakDetector.getContainerByIdGen(id):
|
||||||
yield None
|
yield None
|
||||||
|
except:
|
||||||
|
# TODO
|
||||||
|
self.notify.debug('caught exception in getContainerByIdGen (3)')
|
||||||
|
else:
|
||||||
msg = ('%s (%s) consistently increased in size over the last '
|
msg = ('%s (%s) consistently increased in size over the last '
|
||||||
'5 periods (%s items at last measurement, current contents: %s)' %
|
'5 periods (%s items at last measurement, current contents: %s)' %
|
||||||
(name, itype(container), idx2id2len[self._index][id],
|
(name, itype(container), idx2id2len[self._index][id],
|
||||||
@ -594,9 +609,6 @@ class CheckContainers(Job):
|
|||||||
self.notify.warning(msg)
|
self.notify.warning(msg)
|
||||||
self.notify.info('sending notification...')
|
self.notify.info('sending notification...')
|
||||||
yield None
|
yield None
|
||||||
for result in self._leakDetector.getContainerByIdGen(id):
|
|
||||||
yield None
|
|
||||||
container = result
|
|
||||||
messenger.send(self._leakDetector.getLeakEvent(), [container, name])
|
messenger.send(self._leakDetector.getLeakEvent(), [container, name])
|
||||||
yield Job.Done
|
yield Job.Done
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user