diff --git a/src/langbot/pkg/core/bootutils/log.py b/src/langbot/pkg/core/bootutils/log.py index 407b01fb6..3bf1bb5f6 100644 --- a/src/langbot/pkg/core/bootutils/log.py +++ b/src/langbot/pkg/core/bootutils/log.py @@ -136,7 +136,9 @@ class NonBlockingConsoleHandler(logging.Handler): self._queue.get_nowait() self.dropped_records += 1 except queue.Empty: - pass + # The writer consumed the last record after Full; + # retry inserting the shutdown sentinel. + continue self._worker.join(timeout=CONSOLE_CLOSE_TIMEOUT)