Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Remote call timeout required. #18916

Open
2 tasks done
MissiontoMars opened this issue Sep 27, 2021 · 11 comments
Open
2 tasks done

[Feature] Remote call timeout required. #18916

MissiontoMars opened this issue Sep 27, 2021 · 11 comments
Labels
core Issues that should be addressed in Ray Core core-api P1 Issue that should be fixed within a few weeks usability
Milestone

Comments

@MissiontoMars
Copy link

MissiontoMars commented Sep 27, 2021

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!
@MissiontoMars MissiontoMars added the enhancement Request for new feature and/or capability label Sep 27, 2021
@jovany-wang
Copy link
Contributor

Nice proposal.

  1. Can you add the Java API or usage as well?
  2. Is the implementation that adding a timestamp to the task execution information?

@mwtian
Copy link
Member

mwtian commented Sep 29, 2021

What about child task and method calls? Do timeout / deadline propagate implicitly or explicitly?

@wuisawesome wuisawesome added the core-interface-change-approval-required This changes the Ray core behavior / API and requires broader approvals. label Sep 29, 2021
@ericl
Copy link
Contributor

ericl commented Sep 29, 2021

@mwtian , child tasks are automatically killed when the parent dies, so there's nothing that should need to happen for that to work.

@ericl ericl added P1 Issue that should be fixed within a few weeks usability labels Sep 29, 2021
@ericl ericl added this to the Core Backlog milestone Sep 29, 2021
@pcmoritz
Copy link
Contributor

+1 on the proposal, but it should be timeout and a float that is measured in seconds (instead of timeout_ms as an integer in milliseconds). That's to be consistent with the other timeouts in Ray and also Python timeouts.

@kfstorm
Copy link
Member

kfstorm commented Sep 30, 2021

@ericl Does the task canceling API apply to actor tasks?

@scv119
Copy link
Contributor

scv119 commented Apr 20, 2022

@iycheng is this part of Ray HA?

@rkooo567 rkooo567 added the core Issues that should be addressed in Ray Core label Dec 9, 2022
@akdienes
Copy link

akdienes commented May 5, 2023

this would be great feature to have.

@maxall41
Copy link

Any updates on this?

@raghumdani
Copy link

Hi team, is there any progress on this? We would like to contribute if required.

@anyscalesam anyscalesam added triage Needs triage (eg: priority, bug/not-bug, and owning component) and removed enhancement Request for new feature and/or capability labels May 24, 2024
@jjyao
Copy link
Contributor

jjyao commented May 28, 2024

@MissiontoMars we'd like to work with you on this! Could you create a short REP (https://github.com/ray-project/enhancements) and we can go from there?

@jjyao jjyao removed the triage Needs triage (eg: priority, bug/not-bug, and owning component) label May 28, 2024
@MissiontoMars
Copy link
Author

@MissiontoMars we'd like to work with you on this! Could you create a short REP (https://github.com/ray-project/enhancements) and we can go from there?

Sounds good. Maybe I can submit a short REP in June.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues that should be addressed in Ray Core core-api P1 Issue that should be fixed within a few weeks usability
Projects
None yet
Development

No branches or pull requests