Merge pull request #2118 from akka/wip-3973-joinSeedNodeProcess-name-master-patriknw
=clu #3973 Make JoinSeedNodeProcess actor name unique (forward port)
This commit is contained in:
commit
79e10f5964
2 changed files with 14 additions and 5 deletions
|
|
@ -236,6 +236,7 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef) extends Actor with
|
||||||
var gossipStats = GossipStats()
|
var gossipStats = GossipStats()
|
||||||
|
|
||||||
var seedNodeProcess: Option[ActorRef] = None
|
var seedNodeProcess: Option[ActorRef] = None
|
||||||
|
var seedNodeProcessCounter = 0 // for unique names
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Looks up and returns the remote cluster command connection for the specific address.
|
* Looks up and returns the remote cluster command connection for the specific address.
|
||||||
|
|
@ -372,12 +373,16 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef) extends Actor with
|
||||||
if (seedNodes == immutable.IndexedSeq(selfAddress)) {
|
if (seedNodes == immutable.IndexedSeq(selfAddress)) {
|
||||||
self ! ClusterUserAction.JoinTo(selfAddress)
|
self ! ClusterUserAction.JoinTo(selfAddress)
|
||||||
None
|
None
|
||||||
} else if (seedNodes.head == selfAddress) {
|
|
||||||
Some(context.actorOf(Props(classOf[FirstSeedNodeProcess], seedNodes).
|
|
||||||
withDispatcher(UseDispatcher), name = "firstSeedNodeProcess"))
|
|
||||||
} else {
|
} else {
|
||||||
Some(context.actorOf(Props(classOf[JoinSeedNodeProcess], seedNodes).
|
// use unique name of this actor, stopSeedNodeProcess doesn't wait for termination
|
||||||
withDispatcher(UseDispatcher), name = "joinSeedNodeProcess"))
|
seedNodeProcessCounter += 1
|
||||||
|
if (seedNodes.head == selfAddress) {
|
||||||
|
Some(context.actorOf(Props(classOf[FirstSeedNodeProcess], seedNodes).
|
||||||
|
withDispatcher(UseDispatcher), name = "firstSeedNodeProcess-" + seedNodeProcessCounter))
|
||||||
|
} else {
|
||||||
|
Some(context.actorOf(Props(classOf[JoinSeedNodeProcess], seedNodes).
|
||||||
|
withDispatcher(UseDispatcher), name = "joinSeedNodeProcess-" + seedNodeProcessCounter))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@ abstract class JoinSeedNodeSpec
|
||||||
|
|
||||||
runOn(seed1, seed2, seed3) {
|
runOn(seed1, seed2, seed3) {
|
||||||
cluster.joinSeedNodes(seedNodes)
|
cluster.joinSeedNodes(seedNodes)
|
||||||
|
runOn(seed3) {
|
||||||
|
// it is allowed to call this several times (verifies ticket #3973)
|
||||||
|
cluster.joinSeedNodes(seedNodes)
|
||||||
|
}
|
||||||
awaitMembersUp(3)
|
awaitMembersUp(3)
|
||||||
}
|
}
|
||||||
enterBarrier("after-1")
|
enterBarrier("after-1")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue