Ray: Can't clean up named actor (non-detached)

Created on 3 Sep 2020  路  5Comments  路  Source: ray-project/ray

What is the problem?

Non-detached actor names don't seem to be reclaimed when the actor exits.

Discovered while refactoring Serve to support clusters scoped to the driver program.

Reproduction (REQUIRED)

import time
import ray

ray.init()

@ray.remote
class A:
    pass

a = A.options(name="hello").remote()
ray.kill(a, no_restart=True)
del a

# This loop never exits.
while True:
    try:
        ray.get_actor("hello")
        print("Actor still alive")
    except:
        print("Actor was deleted")
        break
    time.sleep(1)

If we cannot run your script, we cannot fix your issue.

  • [x] I have verified my script runs in a clean environment and reproduces the issue.
  • [x] I have verified the issue also occurs with the latest wheels.
P0 bug

Most helpful comment

re: @rkooo567 that would prevent users from creating non detached actors that are named, which is a key requirement from Ant and also used in RLlib (this was broken by the recent change to couple named with detached).

All 5 comments

@ericl Making this P0 because it is a pretty fundamental issue for the named actor API and it's a blocker for the serve change we want to get in for 1.0. LMK if you disagree.

Little outside topic, but Why don't we make actors detached if name is provided but lifetime is not? It will secretly breaks lots of people's codebase otherwise.

re: @rkooo567 that would prevent users from creating non detached actors that are named, which is a key requirement from Ant and also used in RLlib (this was broken by the recent change to couple named with detached).

Ok I see, it's just an issue with removing the name label, only read the last comment.

Was this page helpful?
0 / 5 - 0 ratings