Discuss cache named actor in core worker locally.
See original GitHub issueBulk users use ray.get_actor(name=xxx)
temporarily, and it’s necessary to enable caching named actor in core worker locally.
Before support it, we’d better to discuss the behavior of ray.get_actor()
.
There 're 2 facts of the current named actor now:
- one is
ray.get_actor()
supports the same name for different actors serially:
a = ActorA.options(name="named_actor").remote()
ray.exit_actor(a, no_restart=True)
b = ActorB.options(name="named_actor").remote() # It does work!!!
- another one is that
ray.get_actor()
will raise aValueError
if the name doesn’t exist.
I’d like to propose these:
(1) named actor doesn’t support duplicated name with different actors. Because this is not a strong requirement and if we enable this, users may use it incorrectly as well.
(2) ray.get_actor()
returning None indicates there doesn’t exist the name, and returning not None indicates we found a handle for the name but we don’t promise the actor is valid. If that’s an invalid handle, remote call will raise the corresponding exception.
BTW, the reason for proposing no duplicated name for different actors is local core worker has no way to be notified the deletion event.(GCS pubs the deletion event is not a good idea.)
After those changes, we can support the TTL for the named actor cache locally.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Tao is working in progress: https://github.com/ray-project/ray/pull/17339
@WangTaoTheTonic will follow up this item.