Try fixing zombie processes
This commit is contained in:
parent
0d9d60e5f1
commit
1f4bfd2a24
2 changed files with 27 additions and 27 deletions
|
|
@ -123,13 +123,13 @@ def parallel_map(
|
|||
ignore_exceptions=ignore_exceptions,
|
||||
)
|
||||
should_stop.set()
|
||||
for p in processes:
|
||||
p.join()
|
||||
p.close()
|
||||
except:
|
||||
for p in processes:
|
||||
p.terminate()
|
||||
raise
|
||||
finally:
|
||||
for p in processes:
|
||||
p.join() # terminated processes have to be joined else they remain zombies
|
||||
p.close()
|
||||
input_queue.close()
|
||||
output_queue.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue