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][experimental] Check whether the channel is closed for the shared memory write operation #46508

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Jul 9, 2024

Why are these changes needed?

  • In Fix for incorrect channel read behavior after accelerated DAG teardown #46320, a check is added in CoreWorker::Get to avoid a mutable object being considered a normal immutable object after the channel is closed and the reader is unregistered.

  • For the channel's write operation, the function CoreWorker::ExperimentalChannelWriteAcquire will only be called by a mutable object, and thus it doesn't have the issue of considering a mutable object as an immutable object.

  • If we write to a channel after it is closed, an exception will be thrown as expected. However, the exception is thrown by MutableObjectManager::WriteAcquire, which is asymmetric with the codepath of the read operation. For the read operation, the exception is thrown by CoreWorker::Get instead of MutableObjectManager. Hence, this PR adds a check in CoreWorker::ExperimentalChannelWriteAcquire.

    RAY_RETURN_NOT_OK(object->header->CheckHasError());

  • Remove IsChannelClosed / ReaderChannelRegistered / WriterChannelRegistered because they are unused after this PR.

Related issue number

#46320 (comment)

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: kaihsun <[email protected]>
Signed-off-by: kaihsun <[email protected]>
@kevin85421 kevin85421 changed the title [WIP] [core][experimental] Check whether the channel is closed for the shared memory write operation Jul 9, 2024
@kevin85421 kevin85421 marked this pull request as ready for review July 9, 2024 20:09
@jackhumphries jackhumphries added the go add ONLY when ready to merge, run all tests label Jul 9, 2024
@jjyao jjyao merged commit a6c3da3 into ray-project:master Jul 10, 2024
6 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.

None yet

3 participants