From 84f886def1f1b6bb5af12e4f6feada2d1e3ea75c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bone=CC=81r?= Date: Thu, 16 Feb 2012 11:20:51 +0100 Subject: [PATCH] Merged with master --- .../src/main/scala/akka/cluster/Gossiper.scala | 16 +++------------- .../cluster/AccrualFailureDetectorSpec.scala | 4 ++-- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/akka-cluster/src/main/scala/akka/cluster/Gossiper.scala b/akka-cluster/src/main/scala/akka/cluster/Gossiper.scala index f37c9294de..bb1e19e746 100644 --- a/akka-cluster/src/main/scala/akka/cluster/Gossiper.scala +++ b/akka-cluster/src/main/scala/akka/cluster/Gossiper.scala @@ -238,7 +238,7 @@ case class Gossiper(system: ActorSystemImpl, remote: RemoteActorRefProvider) { log.info("Node [{}] - Starting cluster Gossiper...", remoteAddress) // try to join the node defined in the 'akka.cluster.node-to-join' option - nodeToJoin foreach join + join() // start periodic gossip to random nodes in cluster val gossipCanceller = system.scheduler.schedule(gossipInitialDelay, gossipFrequency) { @@ -382,22 +382,12 @@ case class Gossiper(system: ActorSystemImpl, remote: RemoteActorRefProvider) { /** * Joins the pre-configured contact point and retrieves current gossip state. */ - private def join(address: Address) { + private def join() = nodeToJoin foreach { address ⇒ setUpConnectionTo(address) foreach { connection ⇒ val command = Join(remoteAddress) - log.info("Node [{}] - Sending [{}] to [{}]", remoteAddress, command, address) + log.info("Node [{}] - Sending [{}] to [{}] through connection [{}]", remoteAddress, command, address, connection) connection ! command } - - contactPoint match { - case None ⇒ log.info("Booting up in singleton cluster mode") - case Some(member) ⇒ - log.info("Trying to join contact point node defined in the configuration [{}]", member) - setUpConnectionTo(member) match { - case None ⇒ log.error("Could not set up connection to join contact point node defined in the configuration [{}]", member) - case Some(connection) ⇒ tryJoinContactPoint(connection, deadline) - } - } } /** diff --git a/akka-cluster/src/test/scala/akka/cluster/AccrualFailureDetectorSpec.scala b/akka-cluster/src/test/scala/akka/cluster/AccrualFailureDetectorSpec.scala index 5f93a8ddf2..034f582e0d 100644 --- a/akka-cluster/src/test/scala/akka/cluster/AccrualFailureDetectorSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/AccrualFailureDetectorSpec.scala @@ -9,8 +9,8 @@ class AccrualFailureDetectorSpec extends AkkaSpec(""" """) { "An AccrualFailureDetector" must { - val conn = Address("akka", "", Some("localhost"), Some(2552)) - val conn2 = Address("akka", "", Some("localhost"), Some(2553)) + val conn = Address("akka", "", "localhost", 2552) + val conn2 = Address("akka", "", "localhost", 2553) "return phi value of 0.0D on startup for each address" in { val fd = new AccrualFailureDetector(system)