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

Fix ResourceWarnings #22419

Closed

Conversation

jonathan-conder-sm
Copy link
Contributor

Why are these changes needed?

This makes unittest logs easier to read which can reduce iteration time.

The GPU one should be uncontroversial.

I added a wait after forcibly killing a subprocess; this doesn't guarantee that the ResourceWarning goes away, but it fixed it for me. Might be better to change the subprocess so it responds to SIGTERM more quickly, but that would take more effort.

The remaining changes close log files after passing them to subprocesses. I noticed a comment on #10279 which claims that they were kept open deliberately. It's possible that I'm missing something, but I think the files are only used by these subprocesses, and most OSs I'm aware of will keep file descriptors open in child processes after the parent closes them. In any case subprocess.Popen duplicates these handles before passing them to the child on POSIX [1] and Windows [2].

[1] https://github.com/python/cpython/blob/07119dd38c9a6e5da84ca8a0a46acdf8a3e60ecf/Lib/subprocess.py#L1541
[2] https://github.com/python/cpython/blob/07119dd38c9a6e5da84ca8a0a46acdf8a3e60ecf/Lib/subprocess.py#L1208

Related issue number

Closes #9546 and #10279.

Checks

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

@rkooo567 rkooo567 self-assigned this Feb 16, 2022
@stale
Copy link

stale bot commented Mar 19, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

  • If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@stale stale bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Mar 19, 2022
@jonathan-conder-sm
Copy link
Contributor Author

would you kindly keep it open

@stale stale bot removed the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Mar 19, 2022
@stale
Copy link

stale bot commented Apr 18, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

  • If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@stale stale bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Apr 18, 2022
@rkooo567 rkooo567 removed their assignment Apr 18, 2022
@stale stale bot removed the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Apr 18, 2022
@stale
Copy link

stale bot commented Jun 19, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

  • If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@stale stale bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jun 19, 2022
@jonathan-conder-sm
Copy link
Contributor Author

I don't want to keep fixing merge conflicts for no reason so I'll just close I guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale The issue is stale. It will be closed within 7 days unless there are further conversation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resource leak in ray/pthon/ray/node.py
2 participants