diff --git a/kobo/worker/logger.py b/kobo/worker/logger.py index d2b09c4..3967e6c 100644 --- a/kobo/worker/logger.py +++ b/kobo/worker/logger.py @@ -89,6 +89,11 @@ def run(self): def write(self, data): """Add data to the queue and set the event for sending queue content.""" + # Discard the data if the thread is not running to prevent deadlock + # when the queue is full. + if not self.is_alive(): + return + if threading.get_ident() != self.ident: self._queue.put(data) self._event.set()