secop/modules: make polling thread more robust

Change-Id: I530088d56e31dc2d415cc1c79b1db9d446c0b391
Reviewed-on: https://forge.frm2.tum.de/review/18259
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
This commit is contained in:
Enrico Faulhaber
2018-06-25 15:04:30 +02:00
parent fb1939d5c8
commit 75e31714b8
2 changed files with 14 additions and 11 deletions

View File

@ -231,13 +231,14 @@ class Readable(Module):
mkthread(self.__pollThread, started_callback)
def __pollThread(self, started_callback):
try:
self.__pollThread_inner(started_callback)
except Exception as e:
self.log.exception(e)
self.status = (self.Status.ERROR, 'polling thread could not start')
started_callback(self)
print(formatExtendedStack())
while True:
try:
self.__pollThread_inner(started_callback)
except Exception as e:
self.log.exception(e)
self.status = (self.Status.ERROR, 'polling thread could not start')
started_callback(self)
print(formatExtendedStack())
def __pollThread_inner(self, started_callback):
"""super simple and super stupid per-module polling thread"""