Skip to content

[Core] Log actor class import failures with their traceback - #66564

Open
xuwwwww wants to merge 4 commits into
ray-project:masterfrom
xuwwwww:improve-actor-import-error
Open

xuwwwww wants to merge 4 commits into
ray-project:masterfrom
xuwwwww:improve-actor-import-error

Conversation

@xuwwwww

@xuwwwww xuwwwww commented Sep 29, 2026 •

Copy link
Copy Markdown

Description

When an actor class fails to import on a worker, Ray logs the failure at DEBUG level and creates a temporary actor to report it later. In the case reported in #49285, the user saw an async actor startup error without the original ModuleNotFoundError in the worker log.

Log the import failure with its traceback at ERROR level. The temporary actor behavior stays the same. A focused test simulates a missing module and checks both the log and the existing fallback error. The test is registered in Bazel and includes a pytest entrypoint.

Related issues

Fixes #49285.

Additional information

I checked the issue and open PRs on 2026-09-29. The issue is open and unassigned, and I found no open PR for this log path.

Tests run on Windows:

  • ..\ray-venv\Scripts\python.exe ..\..\outputs\run-ray-first-pr-test.py — 1 passed after the CI logging fix. This local helper loads the modified function_manager.py over the Ray 2.58.0 binary wheel and sets the ray logger's propagation to False to reproduce the CI condition; it is not part of the PR.
  • The test file's __main__ entrypoint — 1 passed.
  • Applicable pre-commit hooks passed. The Bash-based docstyle and Buildifier hooks could not run through Windows pre-commit. I ran docstyle with Git Bash and checked BUILD.bazel with Buildifier 8.0.1 on an LF-normalized copy; both passed.
  • git diff --check — passed.

AI assistance was used to investigate this issue and prepare the patch and test. The submitter ran the focused test locally.

Signed-off-by: xuwwwww <113529937+xuwwwww@users.noreply.github.com>
@xuwwwww
xuwwwww requested a review from a team as a code owner September 29, 2026 01:30

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the actor class loading logic in function_manager.py to use logger.exception instead of logger.debug when an error occurs, ensuring that the full traceback is captured. Additionally, a new test case has been added to verify that actor import errors are correctly logged. I have no further feedback to provide.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread python/ray/tests/test_function_manager_import_error.py
Comment thread python/ray/tests/test_function_manager_import_error.py
Signed-off-by: xuwwwww <113529937+xuwwwww@users.noreply.github.com>
@ray-gardener ray-gardener Bot added core Issues that should be addressed in Ray Core community-contribution Contributed by the community labels Sep 29, 2026
@rueian rueian added the go add ONLY when ready to merge, run all tests label Sep 29, 2026
@rueian
rueian enabled auto-merge (squash) September 30, 2026 23:18

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 4ccb698. Configure here.

Comment thread python/ray/tests/test_function_manager_import_error.py
Signed-off-by: xuwwwww <113529937+xuwwwww@users.noreply.github.com>
auto-merge was automatically disabled October 1, 2026 00:20

Head branch was pushed to by a user without write access

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

2 participants