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] Fix test_no_worker_child_process_leaks #35840

Merged

Conversation

pcmoritz
Copy link
Contributor

@pcmoritz pcmoritz commented May 27, 2023

Why are these changes needed?

Thanks @iycheng for debugging this!

In #33976 we don't always guarantee that children of worker processes are killed -- namely if the worker dies in an unexpected way, they are not (see #26118).

This unfortunately happens in the test_no_worker_child_process_leaks test case since the Ray cluster is torn down when the driver exits, which can lead to worker processes being forcefully terminated [the solution in this PR is to not initialize the Ray cluster in the driver script but start a separate head node with .add_node].

As a result of this forceful killing, the test becomes flaky (it passes if the workers are killed through the normal termination, and it doesn't pass if the workers are killed otherwise). The flakiness is not super big right now but becomes big with some other changes.

This should eventually be fixed with #26118.

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

@pcmoritz pcmoritz changed the title Fix test_no_worker_child_process_leaks [Core] Fix test_no_worker_child_process_leaks May 27, 2023
@pcmoritz pcmoritz requested a review from cadedaniel May 27, 2023 05:07
Copy link
Member

@cadedaniel cadedaniel left a comment

Choose a reason for hiding this comment

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

nice find and fix! thanks @pcmoritz and @iycheng

@fishbone
Copy link
Contributor

I also created a P1 issue which shouldn't be too hard to fix when worker decide to exit itself.

@pcmoritz pcmoritz merged commit 6e032bb into ray-project:master May 27, 2023
1 of 2 checks passed
@pcmoritz pcmoritz deleted the fix-no-worker-child-process-leaks branch May 27, 2023 07:17
scv119 pushed a commit to scv119/ray that referenced this pull request Jun 16, 2023
Thanks @iycheng for debugging this!

In ray-project#33976 we don't always guarantee that children of worker processes are killed -- namely if the worker dies in an unexpected way, they are not (see ray-project#26118).

This unfortunately happens in the `test_no_worker_child_process_leaks` test case since the Ray cluster is torn down when the driver exits, which can lead to worker processes being forcefully terminated [the solution in this PR is to not initialize the Ray cluster in the driver script but start a separate head node with `.add_node`].

As a result of this forceful killing, the test becomes flaky (it passes if the workers are killed through the normal termination, and it doesn't pass if the workers are killed otherwise). The flakiness is not super big right now but becomes big with some other changes.

This should eventually be fixed with ray-project#26118.
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
Thanks @iycheng for debugging this!

In ray-project#33976 we don't always guarantee that children of worker processes are killed -- namely if the worker dies in an unexpected way, they are not (see ray-project#26118).

This unfortunately happens in the `test_no_worker_child_process_leaks` test case since the Ray cluster is torn down when the driver exits, which can lead to worker processes being forcefully terminated [the solution in this PR is to not initialize the Ray cluster in the driver script but start a separate head node with `.add_node`].

As a result of this forceful killing, the test becomes flaky (it passes if the workers are killed through the normal termination, and it doesn't pass if the workers are killed otherwise). The flakiness is not super big right now but becomes big with some other changes.

This should eventually be fixed with ray-project#26118.

Signed-off-by: e428265 <[email protected]>
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.

None yet

3 participants