Skip to content

Calling ray.shutdown before ray.init makes ray forget function definitions #3897

@pcmoritz

Description

@pcmoritz

This is an error one of our users was running into:

import ray
@ray.remote
def f():
  return 1

ray.shutdown()
ray.init()
ray.get(f.remote())

And ray will print:

This worker was asked to execute a function that it does not have registered. You may have to restart Ray.

Shutdown will clear the function cache and therefore ray.init won't register the right functions. This looks like a user error, but I can see what they are trying to do (making sure any other ray instance has shut down properly I guess).

This is not a bug I think but we might want to print a more informative error message here. And hopefully this issue will point people into the right direction too if this happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issue moderate in impact or severity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions