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][cgraph] Fix flaky test_dag_exception_chained #50271

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

ruisearch42
Copy link
Contributor

Why are these changes needed?

test_dag_exception_chained has the following exception, which causes the next test to fail:


[2025-02-05T01:46:17Z] Exception ignored in: <function CompiledDAG.__del__ at 0x7fc7e6831a80>
--
  | [2025-02-05T01:46:17Z] Traceback (most recent call last):
  | [2025-02-05T01:46:17Z]   File "/rayci/python/ray/dag/compiled_dag_node.py", line 2957, in __del__
  | [2025-02-05T01:46:17Z]     self.teardown()
  | [2025-02-05T01:46:17Z]   File "/rayci/python/ray/dag/compiled_dag_node.py", line 2949, in teardown
  | [2025-02-05T01:46:17Z]     monitor.teardown(kill_actors=kill_actors)
  | [2025-02-05T01:46:17Z]   File "/rayci/python/ray/dag/compiled_dag_node.py", line 1998, in teardown
  | [2025-02-05T01:46:17Z]     outer._dag_submitter.close()
  | [2025-02-05T01:46:17Z]     ^^^^^^^^^^^^^^^^^^^^
  | [2025-02-05T01:46:17Z] ReferenceError: weakly-referenced object no longer exists

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

Signed-off-by: Rui Qiao <[email protected]>
@ruisearch42 ruisearch42 added the go add ONLY when ready to merge, run all tests label Feb 5, 2025
Copy link
Contributor

@dayshah dayshah left a comment

Choose a reason for hiding this comment

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

do you know when this error started happening?

@@ -2090,34 +2090,39 @@ def teardown(self, kill_actors: bool = False):
return
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this protect it from happening if we already destructed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think teardown() is only entered once, but CompiledDAG attributes may already be partially destructed when __del__() is called

Copy link
Contributor

Choose a reason for hiding this comment

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

oh ok got it

@jjyao jjyao merged commit 9b65d8b into ray-project:master Feb 6, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants