Skip to content

Remote function cannot recursively call itself. #398

Closed
@robertnishihara

Description

Consider the following script.

import ray

ray.init()

@ray.remote
def f():
  return ray.get(f.remote())

f.remote()

When f.remote() is called, the following error is printed.

Traceback (most recent call last):
  File "<ipython-input-3-6f5c275d0ce3>", line 3, in f
NameError: name 'f' is not defined

This worked at some point but seems to have gotten broken. We weren't testing recursively defining remote functions because defining remote functions in this manner inside of the Python unit testing framework didn't work. However, we should add tests for this behavior and just not use the unit testing framework for that part.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions