"examples/cpp/git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "5e56575e688a85a3bc9dc3c97934dd864b65ce47"
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: ...@@ -148,6 +148,9 @@ class DistDataLoader:
res.get() res.get()
def __del__(self): 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: if self.pool is not None:
results = [] results = []
for _ in range(self.num_workers): 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