From f786e34a0e9a0e4b7ff19d16a1476f8fe96800bc Mon Sep 17 00:00:00 2001 From: x12sa Date: Mon, 30 Mar 2026 14:41:44 +0200 Subject: [PATCH] fix thread stop --- .../plugins/flomni/flomni_webpage_generator.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_webpage_generator.py b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_webpage_generator.py index 7b13d47..0364576 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_webpage_generator.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_webpage_generator.py @@ -403,6 +403,8 @@ class LocalHttpServer: class _QuietHandler(http.server.SimpleHTTPRequestHandler): def log_message(self, *args): pass + def handle_error(self, request, client_address): + pass # suppress BrokenPipeError and other per-connection noise def start(self) -> None: Handler = functools.partial( @@ -547,8 +549,12 @@ class WebpageGeneratorBase: self._stop_event.set() if self._thread is not None: self._thread.join(timeout=self._cycle_interval + 5) + # Always clear the reference so start() gets a clean slate, + # even if the thread did not exit within the join timeout. + self._thread = None if self._local_server is not None: self._local_server.stop() + self._local_server = None self._release_lock() self._log(VERBOSITY_NORMAL, "WebpageGenerator stopped.") -- 2.52.0