stop poller threads on shutdown

make sure module methods are not called after shutdownModule

+ fix: when mod.enablePoll is False, pollInfo is None
  therefore we have to check before access

Change-Id: I83b28607b25996376939175be8abf0c5b27bcac1
This commit is contained in:
2025-03-17 09:35:11 +01:00
parent 7e2ccd214e
commit 09e596f847
2 changed files with 42 additions and 14 deletions

View File

@@ -19,6 +19,7 @@
#
# *****************************************************************************
import time
import traceback
from collections import OrderedDict
@@ -255,6 +256,15 @@ class SecNode:
def shutdown_modules(self):
"""Call 'shutdownModule' for all modules."""
# stop pollers
for name in self.modules:
self.modules[name].stopPollThread()
# do not yet join here, as we want to wait in parallel
now = time.time()
deadline = now + 5
for name in self.modules:
self.modules[name].joinPollThread(now - deadline)
now = time.time()
for name in self._getSortedModules():
self.modules[name].shutdownModule()