How severe does this issue affect your experience of using Ray?
- Medium: It contributes to significant difficulty to complete my task, but I can work around it.
When trying to use ray.util.multiprocess.Pool
and ray.util.Queue
together I got some errors. The skeleton of my use case is like this
with Pool(processes=num_workers) as pool:
for i in range(num_workers):
queue = Queue()
pool.apply_async(worker_fn,
args=(queue),
error_callback=custom_error_callback)
And
def worker_fn(queue):
while True:
try:
item = queue.get(block=False)
except Empty:
time.sleep(0.0001)
continue
if item is None:
break
# Do some stuff
But it emits an error like:
Got error: The actor died unexpectedly before finishing this task.
class_name: PoolActor
actor_id: c472300a1e76e2c7bece3c7001000000
pid: 60456
namespace: a0dd3b86-d513-4d7b-903d-8a903cf2c893
ip: 127.0.0.1
The actor is dead because it was killed by `ray.kill`.
It seems that someone said this may be caused by Queue
since it is not thread/process safe. So my question is whether there is any other ways to implement the same idea without putting Pool
and Queue
together?