[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:
ZhuSenlin
2020-04-20 00:53:02 +08:00
committed by GitHub
parent da296bf8c5
commit 3f28a8a229
4 changed files with 51 additions and 33 deletions
@@ -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):