From 2fa3e2ea2f81e8d399cf0e18b30b35731838217d Mon Sep 17 00:00:00 2001 From: YangLuo Date: Mon, 21 Sep 2020 22:11:12 +0800 Subject: [PATCH] Add comment for "relax timeout constraint" & "try to call terminate" --- mindspore/dataset/engine/datasets.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mindspore/dataset/engine/datasets.py b/mindspore/dataset/engine/datasets.py index 4136a4195a..2f0a292c64 100644 --- a/mindspore/dataset/engine/datasets.py +++ b/mindspore/dataset/engine/datasets.py @@ -3395,9 +3395,13 @@ class _GeneratorWorkerMp(multiprocessing.Process): """ Get function for worker result queue. Block with timeout. """ + # Relax 10s to 30s, since it sometimes will cause "Generator worker process timeout" + # when we run too many iterators with infinite epoch(num_epoch=-1) return self.res_queue.get(timeout=30) def __del__(self): + # Try to destruct here, sometimes the class itself will be destructed in advance, + # so "self" will be a NoneType try: self.terminate() except AttributeError: