From daee29d7cd46fc2b3bfa50be70066883468bf3fd Mon Sep 17 00:00:00 2001 From: Shivaschandra KL Date: Tue, 16 Dec 2025 04:04:13 -0500 Subject: [PATCH] fix: storage_flush check thread exists before joining Some issue are observed during storage write, happens when the storage_flush is called by client. At server thread join is tried when flush is called in writer, since the stop has already been called thread for the instance is already reinitialized to none, Due to this the at client we observe errors stating calling join on None type. Tested-by: Gourav Singh Signed-off-by: Shivaschandra KL --- mtda/storage/writer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mtda/storage/writer.py b/mtda/storage/writer.py index 332110ba..520360d1 100644 --- a/mtda/storage/writer.py +++ b/mtda/storage/writer.py @@ -93,8 +93,9 @@ def flush(self, size): self._receiving = False self._size = size - self.mtda.debug(2, "storage.writer.flush(): waiting on thread...") - self._thread.join() + if self._thread is not None: + self.mtda.debug(2, "storage.writer.flush(): waiting on thread...") + self._thread.join() result = not self._failed self.mtda.debug(3, f"storage.writer.flush(): {result}")