In Python ProcessPoolExecutor, do you need call shutdown after getting a BrokenProcessPool exception?
Say I have something like this:
pool = ProcessPoolExecutor(max_workers=1)
try:
return pool.submit(
do_something,
).result()
except concurrent.futures.process.BrokenProcessPool as pool_exc:
pool = None
return None
- Is it a bad idea to just set
pool = None
do I need to call shutdown? - What args should I use with shutdown?
pool.shutdown(wait=False, cancel_futures=True)
?