# Ray.state.actor output and actor scheduling

**URL:** <https://discuss.ray.io/t/ray-state-actor-output-and-actor-scheduling/3227>\
**Category:** Ray Core\
**Created:** [August 12, 2021, 1:16pm UTC](https://discuss.ray.io/t/ray-state-actor-output-and-actor-scheduling/3227 "2021-08-12T13:16:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![asm582](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/asm582/32/669_2.png) [@asm582](https://discuss.ray.io/u/asm582)\
**Post date:** [August 12, 2021, 1:16pm UTC](https://discuss.ray.io/t/ray-state-actor-output-and-actor-scheduling/3227/1 "2021-08-12T13:16:53Z")

</div>

Hello,

I was able to get run ray.state.actors() inside ray cluster deployed on minikube by deploying another actor, strangely one of the actors does not have an IP address, here is the output with a warning:

`WARNING: 3 PYTHON workers have been started on a node of the id: fdd43e9454dad6194cfee89d5d7838a4501b7f8286f1feb6fec8c124 and address: 172.17.0.5. This could be a result of using a large number of actors, or it could be a consequence of using nested tasks (see https://github.com/ray-project/ray/issues/3644) for some a discussion of workarounds. {'52f9757c7e3593056e42024a14000000': {'ActorID': '52f9757c7e3593056e42024a14000000', 'Name': '', 'JobID': '14000000', 'Address': {'IPAddress': '172.17.0.5', 'Port': 10003, 'NodeID': 'fdd43e9454dad6194cfee89d5d7838a4501b7f8286f1feb6fec8c124'}, 'OwnerAddress': {'IPAddress': '172.17.0.4', 'Port': 10022, 'NodeID': '6962fd9e65407b74ae3493d7a1679eba46af9d9b072cd5fe2c8cdfb3'}, 'State': 2, 'NumRestarts': 0, 'Timestamp': 1628773717963.0, 'StartTime': 1628773717963, 'EndTime': 0}, '305b193426974e06ad878a6b14000000': {'ActorID': '305b193426974e06ad878a6b14000000', 'Name': '', 'JobID': '14000000', 'Address': {'IPAddress': '', 'Port': 0, 'NodeID': 'fdd43e9454dad6194cfee89d5d7838a4501b7f8286f1feb6fec8c124'}, 'OwnerAddress': {'IPAddress': '172.17.0.4', 'Port': 10022, 'NodeID': '6962fd9e65407b74ae3493d7a1679eba46af9d9b072cd5fe2c8cdfb3'}, 'State': 1, 'NumRestarts': 0, 'Timestamp': 0.0, 'StartTime': 0, 'EndTime': 0}}`

---

<div class="post-metadata">

**Author:** ![asm582](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/asm582/32/669_2.png) [@asm582](https://discuss.ray.io/u/asm582)\
**Post date:** [August 12, 2021, 1:58pm UTC](https://discuss.ray.io/t/ray-state-actor-output-and-actor-scheduling/3227/2 "2021-08-12T13:58:37Z")

</div>

Another question, can you please describe what does state: “int value” indicate in the above log snippet?

---

<div class="post-metadata">

**Author:** ![asm582](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/asm582/32/669_2.png) [@asm582](https://discuss.ray.io/u/asm582)\
**Post date:** [August 16, 2021, 12:56pm UTC](https://discuss.ray.io/t/ray-state-actor-output-and-actor-scheduling/3227/3 "2021-08-16T12:56:38Z")

</div>

Hello, can you please help with the above two questions? thanks

---

<div class="post-metadata">

**Author:** ![ericl](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ericl/32/133_2.png) [@ericl](https://discuss.ray.io/u/ericl)\
**Post date:** [August 16, 2021, 7:56pm UTC](https://discuss.ray.io/t/ray-state-actor-output-and-actor-scheduling/3227/4 "2021-08-16T19:56:48Z")

</div>

ray.state.actors() is not a supported public API call for Ray (we will be privatizing these internal APIs properly soon).

Are there other APIs you can use for your use case?

---

<div class="post-metadata">

**Author:** ![asm582](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/asm582/32/669_2.png) [@asm582](https://discuss.ray.io/u/asm582)\
**Post date:** [August 16, 2021, 8:11pm UTC](https://discuss.ray.io/t/ray-state-actor-output-and-actor-scheduling/3227/5 "2021-08-16T20:11:50Z")

</div>

Hello, @ericl thanks for your reply. ray.state.actors() API is helpful to us to discover actors running on different ray nodes. we are using this API for our use case currently. Can you advise if there is another public API that can help us get actor details from GCS?

Thanks

---

<div class="post-metadata">

**Author:** ![ericl](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ericl/32/133_2.png) [@ericl](https://discuss.ray.io/u/ericl)\
**Post date:** [August 17, 2021, 12:26am UTC](https://discuss.ray.io/t/ray-state-actor-output-and-actor-scheduling/3227/6 "2021-08-17T00:26:01Z")

</div>

One public API (beta) you can use is `ray.util.list_named_actors()`, which gives you a list of named actors that you can query via `get_actor()`.

We are considering extending this to include more metadata. Can you say more about what metadata you need and why you need it?

---

<div class="post-metadata">

**Author:** ![asm582](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/asm582/32/669_2.png) [@asm582](https://discuss.ray.io/u/asm582)\
**Post date:** [August 17, 2021, 1:13pm UTC](https://discuss.ray.io/t/ray-state-actor-output-and-actor-scheduling/3227/7 "2021-08-17T13:13:15Z")

</div>

I am yet to use list\_named\_actors() but I think it is not as rich as ray.state.actors():

1. For list\_named\_actotrs() to work user actors should be named
2. It does not provide IP address of workers running actors
3. It does not provide state information
4. It does not provide metadata about actors which are detached (same is the case with ray.state.actors())

We need metadata to evict ray nodes in a running fixed-size Kubernetes cluster. We want to evict ray nodes that run tasks only if possible.

We have been discussing it here: [Autoscaler node termination behavior when scaled down with helm - #5 by Dmitri](https://discuss.ray.io/t/autoscaler-node-termination-behavior-when-scaled-down-with-helm/2932/5)
