From 3ea3b56eb14b79c7601ecbad9859a93050ddd2dd Mon Sep 17 00:00:00 2001 From: Edward Oakes Date: Mon, 13 Jan 2020 16:39:33 -0600 Subject: [PATCH] Hotfix missing fields in multiprocessing.Pool (#6784) --- python/ray/experimental/multiprocessing/pool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/ray/experimental/multiprocessing/pool.py b/python/ray/experimental/multiprocessing/pool.py index 4a87a6798..ed2e52eaa 100644 --- a/python/ray/experimental/multiprocessing/pool.py +++ b/python/ray/experimental/multiprocessing/pool.py @@ -168,6 +168,8 @@ class IMapIterator: """Base class for OrderedIMapIterator and UnorderedIMapIterator.""" def __init__(self, pool, func, iterable, chunksize=None): + self._pool = pool + self._func = func self._next_chunk_index = 0 # List of bools indicating if the given chunk is ready or not for all # submitted chunks. Ordering mirrors that in the in the ResultThread. @@ -182,7 +184,7 @@ class IMapIterator: [], total_object_ids=self._total_chunks) self._result_thread.start() - for _ in range(len(pool._actor_pool)): + for _ in range(len(self._pool._actor_pool)): self._submit_next_chunk() def _submit_next_chunk(self):