Skip to content

Commit ecade76

Browse files
committed
terminate instead of close to prevent hanging pool.join. Fixes #1
1 parent 2f3aeb3 commit ecade76

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

job_pool/job_pool.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class AbnormalWorkerTerminationError(Exception):
5959

6060

6161
class JobPool:
62-
@threadpool_limits.wrap(limits=1, user_api='blas')
6362
def __init__(
6463
self,
6564
processes: int = 1,
@@ -121,8 +120,7 @@ def checkPool(self, printProgressEvery: int = -1):
121120
):
122121
self.checkForTerminatedProcess(res)
123122
outputs.append(res.get())
124-
self.pool.close()
125-
self.pool.join()
123+
self.stopPool()
126124
return outputs
127125
except (KeyboardInterrupt, SystemExit) as e:
128126
logger.error(f"Caught {e.__class__.__name__}, terminating workers")

0 commit comments

Comments
 (0)