Unverified Commit 97863ab8 authored by Da Zheng's avatar Da Zheng Committed by GitHub
Browse files

[Distributed] Cleanup the process pool correctly when the process exits. (#2781)


Co-authored-by: default avatarxiang song(charlie.song) <classicxsong@gmail.com>
parent 66f7fe8b
......@@ -148,6 +148,9 @@ class DistDataLoader:
res.get()
def __del__(self):
# When the process exits, the process pool may have been closed. We should try
# and get the process pool again and see if we need to clean up the process pool.
self.pool, self.num_workers = get_sampler_pool()
if self.pool is not None:
results = []
for _ in range(self.num_workers):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment