From 5c992a23ee2d35dc4575fedc943c7791341e2e13 Mon Sep 17 00:00:00 2001 From: PatrykGala Date: Tue, 25 Jul 2023 17:12:53 +0200 Subject: [PATCH] fix performance issues on forking process (Linux) (#1407) --- src/neptune/internal/threading/daemon.py | 2 +- .../internal/websockets/websocket_signals_background_job.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/neptune/internal/threading/daemon.py b/src/neptune/internal/threading/daemon.py index c44c4e3f7..4beb6b18d 100644 --- a/src/neptune/internal/threading/daemon.py +++ b/src/neptune/internal/threading/daemon.py @@ -94,7 +94,7 @@ def run(self): if self._state == Daemon.DaemonState.WORKING: self.work() with self._wait_condition: - if self._sleep_time > 0 and not self._is_interrupted(): + if self._sleep_time > 0 and self._state == Daemon.DaemonState.WORKING: self._wait_condition.wait(timeout=self._sleep_time) finally: with self._wait_condition: diff --git a/src/neptune/internal/websockets/websocket_signals_background_job.py b/src/neptune/internal/websockets/websocket_signals_background_job.py index 8c8626e84..8e493a531 100644 --- a/src/neptune/internal/websockets/websocket_signals_background_job.py +++ b/src/neptune/internal/websockets/websocket_signals_background_job.py @@ -62,11 +62,10 @@ def stop(self): self._thread.shutdown_ws_client() def pause(self): - self._thread.shutdown_ws_client() - self._thread.pause() + pass def resume(self): - self._thread.resume() + pass def join(self, seconds: Optional[float] = None): if not self._started or threading.get_ident() == self._thread.ident: