Skip to content

Commit

Permalink
fix: check join_thread attribute in queue when cleaning mp exec
Browse files Browse the repository at this point in the history
  • Loading branch information
percevalw committed Nov 20, 2024
1 parent 1ffa7c6 commit 3dd3072
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions edsnlp/processing/multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3dd3072

Please sign in to comment.