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] Better propogate node death information #45128

Merged
merged 44 commits into from
May 15, 2024

Conversation

ruisearch42
Copy link
Contributor

@ruisearch42 ruisearch42 commented May 3, 2024

Why are these changes needed?

This is the first PR of a series to better propagate and expose node death information.

Background: in Ray, a node can be either ALIVE or DEAD, and the death reason of a node could be unexpected (e.g., crash) or expected (e.g., idle termination or spot preemption). Currently, GCS knows the actual death reason, but this information is not shown to the users. As a result, users might think a node crashes when they see it is DEAD, while in reality these could be expected scenarios such as spot preemption. This may give users the wrong impression that Ray is unstable. In the series of changes, we are going to better propagate and expose the node death info.

This PR does the following:

  • Add reason_message to NodeDeathInfo so that we track more verbose node death info
  • Introduce UnregisterNode PRC in GCS and use it instead of DrainNode RPC wherever appropriate

This PR is the basis for future changes where we:

  • Maintain and expose the proper node death information for cases where cloud provider forcefully kill the instance before node draining is complete
  • Expose node death information to dashboard as well as exception/error messages

See more details in design doc:
https://docs.google.com/document/d/1tn6Uj-SoEAaBu5_HWl4dNo3JBzTd_w09RPsIWQpUU_s/edit

Related issue number

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 :(

ruisearch42 and others added 27 commits May 3, 2024 18:27
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
This reverts commit dd3d285.

Signed-off-by: Rui Qiao <[email protected]>
This reverts commit 7acc550.

Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
@ruisearch42 ruisearch42 marked this pull request as ready for review May 13, 2024 21:56
Copy link
Collaborator

@jjyao jjyao left a comment

Choose a reason for hiding this comment

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

LG

src/ray/gcs/gcs_client/accessor.cc Outdated Show resolved Hide resolved
src/ray/gcs/gcs_server/gcs_node_manager.cc Show resolved Hide resolved
ruisearch42 and others added 2 commits May 13, 2024 17:40
Copy link
Collaborator

@jjyao jjyao left a comment

Choose a reason for hiding this comment

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

Let's add some tests

src/ray/gcs/gcs_client/accessor.cc Outdated Show resolved Hide resolved
src/ray/gcs/gcs_client/accessor.h Outdated Show resolved Hide resolved
src/ray/gcs/gcs_client/accessor.h Outdated Show resolved Hide resolved
src/ray/gcs/gcs_server/gcs_node_manager.cc Show resolved Hide resolved
src/ray/raylet/agent_manager.cc Outdated Show resolved Hide resolved
src/ray/raylet/main.cc Outdated Show resolved Hide resolved
src/ray/raylet/node_manager.cc Outdated Show resolved Hide resolved
src/ray/raylet/runtime_env_agent_client.cc Outdated Show resolved Hide resolved
src/ray/raylet/scheduling/local_resource_manager.cc Outdated Show resolved Hide resolved
ruisearch42 and others added 7 commits May 13, 2024 23:04
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Copy link
Collaborator

@jjyao jjyao left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
@jjyao
Copy link
Collaborator

jjyao commented May 14, 2024

[2024-05-14T22:35:24Z] Traceback (most recent call last):
[2024-05-14T22:35:24Z]   File "ci/lint/pytest_checker.py", line 126, in <module>
[2024-05-14T22:35:24Z]     main(data)
[2024-05-14T22:35:24Z]   File "ci/lint/pytest_checker.py", line 111, in main
[2024-05-14T22:35:24Z]     raise RuntimeError(
[2024-05-14T22:35:24Z] RuntimeError: Found py_test files without `if __name__ == "__main__":` snippet:
[2024-05-14T22:35:24Z] python/ray/tests/test_node_death.py
[2024-05-14T22:35:24Z] If this is intentional, please add a `no_main` tag to bazel BUILD entry for those files.

Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
@jjyao jjyao merged commit a475ffe into ray-project:master May 15, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants