Open PRESIDENT810 opened 1 year ago
This should be an easy fix. Please assign this to me and I will fix it quickly.
Yeah @PRESIDENT810 can you make a PR?
Yeah @PRESIDENT810 can you make a PR?
Yeah sure, I'm working on it.
Btw this method has another problem, as I mentioned in #38635. I submitted my PR in #38641 to fix that issue. Mind if take a look, and merge that PR first if that's OK?
What happened + What you expected to happen
ray.init()
@ray.remote class Foo: @ray.method(num_returns=2) def some_task(self, x):
Simulate some work
actors = [Foo.remote() for _ in range(2)] pool = ActorPool(actors)
pool.submit(lambda a, v: a.some_task.remote(v), 1) pool.get_next(timeout=1, ignore_if_timedout=True)
Traceback (most recent call last): File "/Users/zhongkaining/PycharmProjects/pythonProject1/main.py", line 19, in
pool.get_next(timeout=1, ignore_if_timedout=True)
File "/usr/local/lib/python3.11/site-packages/ray/util/actor_pool.py", line 283, in getnext
res, = ray.wait([future], timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ray/_private/auto_init_hook.py", line 24, in auto_init_wrapper
return fn(*args, *kwargs)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ray/_private/client_mode_hook.py", line 103, in wrapper
return func(args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ray/_private/worker.py", line 2701, in wait
raise TypeError(
TypeError: wait() expected a list of ray.ObjectRef or ray.StreamingObjectRefGenerator, got list containing <class 'list'>
import ray from ray.util import ActorPool
ray.init()
@ray.remote class Foo: @ray.method(num_returns=2) def some_task(self, x):
Simulate some work
actors = [Foo.remote() for _ in range(2)] pool = ActorPool(actors)
pool.submit(lambda a, v: a.some_task.remote(v), 1) pool.get_next(timeout=1, ignore_if_timedout=True)