From 3dd307207242172d47014b022cd75bd99789f617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Perceval=20Wajsb=C3=BCrt?= Date: Wed, 20 Nov 2024 16:31:47 +0100 Subject: [PATCH] fix: check join_thread attribute in queue when cleaning mp exec --- changelog.md | 6 ++++++ edsnlp/processing/multiprocessing.py | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 133f20fc3..eb813e7c4 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +# Unreleased + +### Fixed + +- Fix `join_thread` missing attribute in `SimpleQueue` when cleaning a multiprocessing executor + ## v0.14.0 (2024-11-14) ### Added diff --git a/edsnlp/processing/multiprocessing.py b/edsnlp/processing/multiprocessing.py index af288c0a2..673940d3d 100644 --- a/edsnlp/processing/multiprocessing.py +++ b/edsnlp/processing/multiprocessing.py @@ -452,7 +452,8 @@ def run(self): for stage in self.stages_to_run: for name, queue in self.consumer_queues(stage): queue.close() - queue.join_thread() + if hasattr(queue, "join_thread"): + queue.join_thread() self.final_barrier.wait() @@ -1182,7 +1183,8 @@ def feed_queue(self, queue, items): if q is queue: queue.put(STOP) queue.close() - queue.join_thread() + if hasattr(queue, "join_thread"): + queue.join_thread() def dequeue_notifications(self): while True: