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

RegisterOnMemberUp() does not fire immediately if cluster already up #2442

Closed
ayoung opened this issue Jan 11, 2017 · 4 comments · Fixed by #2446
Closed

RegisterOnMemberUp() does not fire immediately if cluster already up #2442

ayoung opened this issue Jan 11, 2017 · 4 comments · Fixed by #2446

Comments

@ayoung
Copy link
Contributor

ayoung commented Jan 11, 2017

If the cluster member is already up, calling cluster.RegisterOnMemberUp(callback) does not immediately call the callback.

According to this code here

@Danthar
Copy link
Member

Danthar commented Jan 11, 2017

Hmm. @Horusiath does the JVM work like this as well ?
Im hesitant to mark this as an bug. Because the same issue would apply to all places where you register status callbacks on the cluster extension. Which is due to the async nature of the whole system of course.

I would say this is an problem that needs to be solved in user space. By having the user check the cluster readview for this scenario, should it apply.
Thoughts? @Aaronontheweb

@ayoung
Copy link
Contributor Author

ayoung commented Jan 11, 2017

It seems like an inconsistency with how RegisterOnMemberRemoved() works. That method immediately calls the callback if the member is terminated.

@Aaronontheweb
Copy link
Member

Actually, I wonder if this is true... let me run an experiment real quick.

@Aaronontheweb
Copy link
Member

@ayoung so it turns out that this isn't an issue, and the test I added in #2446 verifies it.

TL;DR;, the reason for the different code in the RegisterOnMemberRemoved is because the actors responsible for executing RegisterOnMember[X] callbacks are terminated by that point in time. In the event of RegisterOnMemberUp, if a callback is added after the cluster has started the actor will check to see if the current member is already in that state (MemberUp), and if so will proceed to invoke the callback immediately rather than wait for another event.

@Aaronontheweb Aaronontheweb modified the milestone: 1.1.3 Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants