fix a race condition in ClusterReadView #24710 (#26922)

* remove lazy initialization for _cachedSelf
* don't update _state and friends after close()
This commit is contained in:
Patrik Nordwall 2019-05-23 14:08:26 +02:00 committed by Arnout Engelen
parent 3015f197f1
commit a6f717c9b0
5 changed files with 21 additions and 46 deletions

View file

@ -118,7 +118,6 @@ abstract class MinMembersBeforeUpBase(multiNodeConfig: MultiNodeConfig)
runOn(first) {
cluster.join(myself)
awaitAssert {
clusterView.refreshCurrentState()
clusterView.status should ===(Joining)
}
}
@ -132,7 +131,6 @@ abstract class MinMembersBeforeUpBase(multiNodeConfig: MultiNodeConfig)
runOn(first, second) {
val expectedAddresses = Set(first, second).map(address)
awaitAssert {
clusterView.refreshCurrentState()
clusterView.members.map(_.address) should ===(expectedAddresses)
}
clusterView.members.unsorted.map(_.status) should ===(Set(Joining))

View file

@ -251,7 +251,6 @@ trait MultiNodeClusterSpec extends Suite with STMultiNodeSpec with WatchedByCoro
cluster.join(joinNode)
awaitCond(
{
clusterView.refreshCurrentState()
if (memberInState(joinNode, List(MemberStatus.Up)) &&
memberInState(myself, List(MemberStatus.Joining, MemberStatus.Up)))
true

View file

@ -65,12 +65,10 @@ abstract class TransitionSpec
}
def awaitMembers(addresses: Address*): Unit = awaitAssert {
clusterView.refreshCurrentState()
memberAddresses should ===(addresses.toSet)
}
def awaitMemberStatus(address: Address, status: MemberStatus): Unit = awaitAssert {
clusterView.refreshCurrentState()
memberStatus(address) should ===(status)
}