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

Checking the state of the Node in NotifyLeave #293

Open
krivoguzovVlad opened this issue Nov 9, 2023 · 0 comments
Open

Checking the state of the Node in NotifyLeave #293

krivoguzovVlad opened this issue Nov 9, 2023 · 0 comments

Comments

@krivoguzovVlad
Copy link

I would like to check whether the service was stopped gracefully in NotifyLeave. The callback accepts a Node with a State field, but it is always equal to StateAlive.

Having looked at the code, I believe that the problem is that the State field is simultaneously declared in both Node and nodeState structs, while Node is nested in nodeState. Could someone explain if there are reasons to do this?

I see several solutions, but unfortunately they are not backwards compatible:

  • add a getter and setter for nodeState, which will also change Node.State. At the same time, make the State field private.
  • remove State field from nodeState
  • remove the State field from Node, and add a separate parameter with the state to NotifyLeave
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

No branches or pull requests

1 participant