This will filter the selfnode from the list of nodes received and warn if it's encountered.
I'm not sure if this is the prettiest approach but I tested and it does work. This is a fairly easy scenario to produce. Using a fixed ip address, If we shutdown the old nodes and then try to start up again nodes can see the selfnode while other nodes are acquiring the lock and trying to start up
[WARN][17:43:10.907][d.h.c.ConstructrMachine][C:] - Selfnode received in list of nodes Set(akka.tcp://testcartCluster@10.102.3.6:2756). Will filter to prevent forming an island.
[WARN][17:43:10.908][d.h.c.ConstructrMachine][C:] - Couldn't acquire lock, going to GettingNodes
[WARN][17:43:10.909][d.h.c.ConstructrMachine][C:] - Selfnode received in list of nodes Set(akka.tcp://testcartCluster@10.102.3.6:2756). Will filter to prevent forming an island.
[WARN][17:43:10.910][d.h.c.ConstructrMachine][C:] - Couldn't acquire lock, going to GettingNodes
The filtering is done in the retrieve section which is significant - the node will be filtered before determining if there are nodes or not. The implication is that if only the self node exists, it will attempt to lock if the only node is selfNode as it would be filtered.
Re: https://github.com/hseeberger/constructr/issues/159
This will filter the selfnode from the list of nodes received and warn if it's encountered.
I'm not sure if this is the prettiest approach but I tested and it does work. This is a fairly easy scenario to produce. Using a fixed ip address, If we shutdown the old nodes and then try to start up again nodes can see the selfnode while other nodes are acquiring the lock and trying to start up
The filtering is done in the retrieve section which is significant - the node will be filtered before determining if there are nodes or not. The implication is that if only the self node exists, it will attempt to lock if the only node is selfNode as it would be filtered.