mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 03:37:20 +08:00
[GCS] reply to the owner only after the actor has been successfully created. (#8079)
* reply to the owner only after the actor is successfully created. * reply immediately if the actor is already created * fix comment * add test_actor_creation_task provided by @Stephanie Wang Co-authored-by: senlin.zsl <senlin.zsl@antfin.com>
This commit is contained in:
@@ -162,6 +162,29 @@ def test_dependency_refcounts(ray_start_regular):
|
||||
check_refcounts({})
|
||||
|
||||
|
||||
def test_actor_creation_task(ray_start_regular):
|
||||
@ray.remote
|
||||
def large_object():
|
||||
# This will be spilled to plasma.
|
||||
return np.zeros(10 * 1024 * 1024, dtype=np.uint8)
|
||||
|
||||
@ray.remote(resources={"init": 1})
|
||||
class Actor:
|
||||
def __init__(self, dependency):
|
||||
return
|
||||
|
||||
def ping(self):
|
||||
return
|
||||
|
||||
a = Actor.remote(large_object.remote())
|
||||
ping = a.ping.remote()
|
||||
ready, unready = ray.wait([ping], timeout=1)
|
||||
assert not ready
|
||||
|
||||
ray.experimental.set_resource("init", 1)
|
||||
ray.get(ping)
|
||||
|
||||
|
||||
def test_basic_pinning(one_worker_100MiB):
|
||||
@ray.remote
|
||||
def f(array):
|
||||
|
||||
Reference in New Issue
Block a user