Hi,

we're using Akka 2.3.0. In our tests with clustering, we noticed that it 
can happen that, after the node has received the MemberUp event, if we 
check the members variable of the Cluster.state object immediately 
afterwards, sometimes the member list is empty. This happens quite often 
(about 50% of the times), meaning that probably we access the variable when 
the members has not been added yet, even though we have already received 
the MemberUp event.

We're just starting the first node of the cluster (with no other nodes 
running), and we tried to access the member list both in the 
registerOnMemberUp callback and when we receive the MemberUp event, with 
the same results in both cases: sometimes it's empty, while some other 
times it correctly contains the node itself.

If we check cluster.state.leader, this is always correctly set with the 
current node address, even when the member list is empty. So the state 
appears to be inconsistent (i.e. it appears to have a leader but no 
members!).

We also tried to call Cluster.sendCurrentClusterState(self). In the message 
that we receive afterwards, the members variable always contains the 
current node, so this seems the correct way to access cluster state 
information, though we don't know if this happens just because some time 
has elapsed.

Is this by design? Which is the safe way to know which members a cluster 
has when a node comes up? The documentation does not mention any 
limitations to using the Cluster.state object. Actually, it looks like 
should be the intended way to access cluster state information.

Another thing we noticed is that the registerOnMemberUp callback and the 
MemberUp event are executed concurrently. So we were wondering which is the 
purpose of registerOnMemberUp compared to processing the MemberUp event.

Thanks to anyone that will help.
Tommaso.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to