Skip to content

[core] Fix gRPC callback API destruction issues. - #32151

Merged
fishbone merged 6 commits into
ray-project:masterfrom
fishbone:test-syncer
Feb 9, 2023
Merged

[core] Fix gRPC callback API destruction issues.#32151
fishbone merged 6 commits into
ray-project:masterfrom
fishbone:test-syncer

Conversation

@fishbone

@fishbone fishbone commented Feb 1, 2023

Copy link
Copy Markdown
Contributor

Signed-off-by: Yi Cheng 74173148+iycheng@users.noreply.github.com

Why are these changes needed?

For gRPC callback API, in the server and client side, the lifecycle is different.

For server, it has to call Finish to make the call be considered as dead by gRPC and this can only be called once.
For client, it will destruct itself if it receive the signal from the server or the connection is broken due to some reasons.

There are two issues here in ray syncer:

  • server might call Finish twice because server has OnWriteDone/OnReadDone.
    • The fix is that when error happened, we'll call Finish and we'll guarantee that it's only called once.
  • client might destruct itself, because client didn't have anything added to control that.
    • The fix is to add AddHole/RemoveHole in the code to explicit control that just like server side.

Testing is tricky, but it can be caught by nightly tests.

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

Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.github.com>
Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.github.com>
Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.github.com>
Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.github.com>
@fishbone fishbone changed the title to master [core] Fix gRPC callback API destruction issues. Feb 5, 2023
Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.github.com>
@fishbone
fishbone marked this pull request as ready for review February 8, 2023 01:39
Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.github.com>
@fishbone
fishbone merged commit fc81af1 into ray-project:master Feb 9, 2023
edoakes pushed a commit to edoakes/ray that referenced this pull request Mar 22, 2023
For gRPC callback API, in the server and client side, the lifecycle is different.

For server, it has to call Finish to make the call be considered as dead by gRPC and this can only be called once.
For client, it will destruct itself if it receive the signal from the server or the connection is broken due to some reasons.

There are two issues here in ray syncer:

server might call Finish twice because server has OnWriteDone/OnReadDone.
The fix is that when error happened, we'll call Finish and we'll guarantee that it's only called once.
client might destruct itself, because client didn't have anything added to control that.
The fix is to add AddHole/RemoveHole in the code to explicit control that just like server side.
Testing is tricky, but it can be caught by nightly tests.

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
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.

3 participants