stop poller threads on shutdown: cosmetics

cosmetics after gerrit

Change-Id: I4d982f83e3fe5a8c8c821ac718e51b9a58de2a62
This commit is contained in:
2025-03-19 15:33:25 +01:00
parent 5d175b89ca
commit b35c97f311
2 changed files with 7 additions and 8 deletions

View File

@@ -257,13 +257,13 @@ class SecNode:
def shutdown_modules(self):
"""Call 'shutdownModule' for all modules."""
# stop pollers
for name in self.modules:
self.modules[name].stopPollThread()
for mod in self.modules.values():
mod.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)
deadline = now + 0.5 # should be long enough for most read functions to finish
for mod in self.modules.values():
mod.joinPollThread(max(0, deadline - now))
now = time.time()
for name in self._getSortedModules():
self.modules[name].shutdownModule()