From 4a8da80c7c92b129874ae7e98a8bd2d73637161a Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 11 Mar 2023 23:45:46 +0100 Subject: [PATCH] Don't join self._thread on stop in RunnablePlugin if self._thread = current_thread --- platypush/plugins/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/__init__.py b/platypush/plugins/__init__.py index 802a674ad1..d4be190ccd 100644 --- a/platypush/plugins/__init__.py +++ b/platypush/plugins/__init__.py @@ -126,7 +126,11 @@ class RunnablePlugin(Plugin): Stop the plugin. """ self._should_stop.set() - if self._thread and self._thread.is_alive(): + if ( + self._thread + and self._thread != threading.current_thread() + and self._thread.is_alive() + ): self.logger.info('Waiting for the plugin to stop') try: if self._thread: