Skip to content

Commit 7a58d7d

Browse files
authored
Explicitly close & join multiprocessing.Pool in extract_ir (#257)
`Pool.__exit__` just calls `terminate`, but it seems there could be a race condition with the processes that handle `map` and their exiting.
1 parent 83b359b commit 7a58d7d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler_opt/tools/extract_ir.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ def main(argv):
343343

344344
with multiprocessing.Pool(FLAGS.num_workers) as pool:
345345
relative_output_paths = pool.map(extract_artifacts, objs)
346+
pool.close()
347+
pool.join()
346348

347349
# This comes first rather than later so global_command_override is at the top
348350
# of the .json after being written

0 commit comments

Comments
 (0)