Skip to content

[Core] Handle raw PermissionError in child process walk - #10856

Merged
aylei merged 1 commit into
skypilot-org:masterfrom
amitgelber:feature/10855-handle-raw-permissionerror
Sep 30, 2026
Merged

aylei merged 1 commit into
skypilot-org:masterfrom
amitgelber:feature/10855-handle-raw-permissionerror

Conversation

@amitgelber

@amitgelber amitgelber commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Treat a raw built-in PermissionError from psutil.Process.children(recursive=True) like psutil.AccessDenied, so the resilient /proc fallback added in #9806 still runs when Ray-vendored psutil does not translate the exception. Preserve the denied path in the warning and cover the behavior with a regression test.

Fixes #10855.

Tested:

  • Code formatting: targeted YAPF and isort checks pass for both changed files; Pylint and mypy pass for subprocess_utils.py
  • Any manual or new tests for this PR: .venv/bin/pytest -q -n 0 tests/unit_tests/test_sky/utils/test_subprocess_utils.py
  • All smoke tests: /smoke-test (CI) or pytest tests/test_smoke.py (local)
  • Relevant individual tests: /smoke-test -k test_name (CI) or pytest tests/test_smoke.py::test_name (local)
  • Backward compatibility: /quicktest-core (CI) or pytest tests/smoke_tests/test_backward_compat.py (local)

Manual runtime verification remains: reproduce on a Linux managed-job runtime using a Ray/psutil build that surfaces raw PermissionError, and confirm cleanup logs the denied path and continues through the fallback instead of failing the task.


Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

βœ… Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@aylei

aylei commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

/smoke-test -k cancel --kubernetes

@aylei aylei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks @amitgelber !

@aylei
aylei merged commit b71f149 into skypilot-org:master Sep 30, 2026
23 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.

Raw PermissionError from psutil child walk bypasses _safe_children fallback

2 participants