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

[Core] Update documentation on ray.get on exception behavior #47730

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

dentiny
Copy link
Contributor

@dentiny dentiny commented Sep 18, 2024

Issue proposes to have better documentation on the timing to raise an exception when any task fails.

Closes #47231

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@dentiny dentiny force-pushed the hjiang/ray-get-crashed-actor-doc branch from 4cfb028 to 967867c Compare September 18, 2024 10:36
Comment on lines 2641 to 2643
It's worth noting, if any actor is crashed, and if you do `ray.get`
on crashed/uncrashed actors together, an exception won't be raised
until uncrashed actors are finished.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What we want to document is the intended behavior that if you ray.get() multiple objects, if one object is an exception, ray.get() will immediately return without waiting for the remaining ones to finish. You can test it out by

import ray
import time

ray.init()

@ray.remote
def task1():
  raise ValueError("fail")

@ray.remote
def task2():
  time.sleep(1000000)


ray.get([task1.remote(), task2.remote()])

The PR you referred is actually a bug since it doesn't conform to the intended behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah gotcha, sorry I thought it's asking to document known issues part. Updated comments, thanks for the example!

@dentiny dentiny force-pushed the hjiang/ray-get-crashed-actor-doc branch from fbd80a1 to ff90a78 Compare September 19, 2024 08:37
@dentiny dentiny requested a review from jjyao September 19, 2024 08:38
@jjyao jjyao added the go add ONLY when ready to merge, run all tests label Sep 19, 2024
@jjyao jjyao changed the title doc: Update documentation on ray.get on crashed actor behavior [Core] Update documentation on ray.get on exception behavior Sep 19, 2024
@jjyao jjyao enabled auto-merge (squash) September 19, 2024 20:39
@jjyao jjyao disabled auto-merge September 19, 2024 20:39
@jjyao jjyao merged commit 5f69744 into ray-project:master Sep 19, 2024
6 of 7 checks passed
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] Update the ray.get documentation to clarify when an exception gets raised for a list of object refs
2 participants