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] Graceful shutdown in TaskEventBuffer destructor #35857

Merged

Conversation

rickyyx
Copy link
Contributor

@rickyyx rickyyx commented May 29, 2023

Why are these changes needed?

When the core worker quick exits, there's a chance that the additional thread owned by the TaskEventBufferImpl hasn't been joined yet, resulting in errors in the stacktrace.

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: Ricky Xu <xuchen727@hotmail.com>
@rkooo567
Copy link
Contributor

rkooo567 commented Jun 1, 2023

  {
    absl::MutexLock lock(&mutex_);
    // It's now safe to disconnect the GCS client since it will not be used by any
    // callbacks.
    gcs_client_->Disconnect();
  }

This part from Stop(), is this still valid? Maybe you should check if this is nullptr or not

@rkooo567
Copy link
Contributor

rkooo567 commented Jun 1, 2023

Also what's the error message when this issue comes up? I am a little worried this won't actually fix the issue depending on the destructor order.

Maybe it is better adding shutdown flag and make periodic job no-op when shutdown == true?

@rkooo567
Copy link
Contributor

rkooo567 commented Jun 1, 2023

or have you verified this fixes the issue manually?

@rkooo567 rkooo567 added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Jun 1, 2023
rickyyx added 3 commits June 29, 2023 16:55
Signed-off-by: rickyyx <rickyx@anyscale.com>
@rickyyx rickyyx added tests-ok The tagger certifies test failures are unrelated and assumes personal liability. and removed @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. labels Jun 30, 2023
@rickyyx
Copy link
Contributor Author

rickyyx commented Jun 30, 2023

or have you verified this fixes the issue manually?

Yes - i verified by running some workload (microbenchmars) and see the error not showing up.

@rkooo567 rkooo567 merged commit 50d6496 into ray-project:master Jun 30, 2023
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
…5857)

When the core worker quick exits, there's a chance that the additional thread owned by the TaskEventBufferImpl hasn't been joined yet, resulting in errors in the stacktrace.

Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests-ok The tagger certifies test failures are unrelated and assumes personal liability.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants