check for missing supercalls to module init methods

Change-Id: I8b7fe5cdd2883fd45532a3e8ac2d7b32945b36a3
This commit is contained in:
2021-12-21 09:46:50 +01:00
parent 245f4f48bf
commit 8253fe471b
2 changed files with 18 additions and 4 deletions

View File

@ -281,6 +281,8 @@ class Server:
modobj.pollerClass.add_to_table(poll_table, modobj)
# also call earlyInit on the modules
modobj.earlyInit()
if not modobj.earlyInitDone:
modobj.log.warning('missing supercall to earlyInit')
# handle attached modules
for modname, modobj in self.modules.items():
@ -296,6 +298,8 @@ class Server:
for modname, modobj in self.modules.items():
try:
modobj.initModule()
if not modobj.initModuleDone:
modobj.log.warning('missing supercall to initModule')
except Exception as e:
if failure_traceback is None:
failure_traceback = traceback.format_exc()
@ -319,6 +323,8 @@ class Server:
event = threading.Event()
# startModule must return either a timeout value or None (default 30 sec)
timeout = modobj.startModule(started_callback=event.set) or 30
if not modobj.startModuleDone:
modobj.log.warning('missing supercall to startModule')
start_events.append((time.time() + timeout, 'module %s' % modname, event))
for poller in poll_table.values():
event = threading.Event()