Skip to content

[Feature] Remote call timeout required. #18916

Open
@MissiontoMars

Description

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

Why the feature needed?

Feature required from our users. The current remote call design lacks a timeout mechanism, actor.foo.remote() will be executed in the end. The user may expect the remote call to be completed in a certain period of time, if not, then give up. If the producer actor send lots of calls in a short time, some calls which destined to be timeout will also be executed, that's unnecessary.

API

Set timeout_ms option when do remote call. e.g.:

@ray.remote
    class Foo:
        def method(self):
            return 1
    f = Foo.remote()
    f.method.options(timeout_ms=500).remote()

When the caller actor send out the task, put the current timestamp in taskspec, and on the callee actor side, check the timestamp with current system time when prepare to execute the task, if timeout, give up.

Other considerations

  1. The user can do the similar things by themself. Add an extra timestamp parameter in mthod, and do not execute the bussiness code when timeout. But I think it would be more convenient to support this option in Ray.
  2. The time synchronization problem in distributed systems, makes the timeout not 100% accurate. But in most cases it's not a problem.

Use case

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Metadata

Assignees

No one assigned

    Labels

    P1Issue that should be fixed within a few weekscoreIssues that should be addressed in Ray Corecore-apienhancementRequest for new feature and/or capabilityusability

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions