Double-check if self._thread != None on stop on the ntfy thread

Race conditions may occur here
This commit is contained in:
Fabio Manganiello 2023-01-27 22:12:34 +01:00
parent 341e749d23
commit 0e56d0fff6
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -110,7 +110,7 @@ class RunnablePlugin(Plugin):
try: try:
if self._thread: if self._thread:
self._thread.join(timeout=self._stop_timeout) self._thread.join(timeout=self._stop_timeout)
if self._thread.is_alive(): if self._thread and self._thread.is_alive():
self.logger.warning( self.logger.warning(
f'Timeout (seconds={self._stop_timeout}) on ' f'Timeout (seconds={self._stop_timeout}) on '
'exit for the plugin ' 'exit for the plugin '