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][Core-worker] fix the initialization/destruction order between reference_counter_ and node change subscription. #29108

Merged
merged 4 commits into from
Oct 6, 2022

Conversation

scv119
Copy link
Contributor

@scv119 scv119 commented Oct 6, 2022

Why are these changes needed?

we experienced segfault in core worker recently in some of our nightly tests. As we investigated this is likely caused by that when we get a callback from gcs client that the node has changed, the underlining reference_counter_ which handles the changed callback is not initialized (likely) or already being destructed.

Fix:

  1. ensure reference_counter_ is initialized before the callback is registered,
  2. capture the shared ownership of reference_counter in the callback.
    we should be able to fix the bug.

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

@scv119 scv119 marked this pull request as ready for review October 6, 2022 01:03
@scv119 scv119 changed the title [Core][Core-worker] fix the initialization order [Core][Core-worker] fix the initialization/destruction order Oct 6, 2022
@scv119 scv119 changed the title [Core][Core-worker] fix the initialization/destruction order [Core][Core-worker] fix the initialization/destruction order between reference_counter_ and node change subscription. Oct 6, 2022
Copy link
Contributor

@rickyyx rickyyx left a comment

Choose a reason for hiding this comment

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

Ah - seems very likely to me!

Should we kick off the 2 release tests relevant to this change? Not sure how consistently it was failing.


via GIPHY

@scv119 scv119 merged commit 207efc9 into ray-project:master Oct 6, 2022
WeichenXu123 pushed a commit to WeichenXu123/ray that referenced this pull request Dec 19, 2022
…reference_counter_ and node change subscription. (ray-project#29108)

Why are these changes needed?
we experienced segfault in core worker recently in some of our nightly tests. As we investigated this is likely caused by that when we get a callback from gcs client that the node has changed, the underlining reference_counter_ which handles the changed callback is not initialized (likely) or already being destructed.

Fix:

ensure reference_counter_ is initialized before the callback is registered,
capture the shared ownership of reference_counter in the callback.
we should be able to fix the bug.

Signed-off-by: Weichen Xu <[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.

[core][release] chaos_dataset_shuffle_random_shuffle_1tb failing with segfaults
5 participants