From 4785ed1b48c8ad7c7430cb13d27f22813da84d42 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Wed, 9 Dec 2020 17:29:06 +0100 Subject: [PATCH] Better logging when no seed nodes found (#29866) In a recent support case the 'manual cluster join required' log message caused some confusion. Turns out the configuration we used to detect whether Cluster Bootstrap is available has been changed since https://github.com/akka/akka-management/pull/476 Unfortunately I don't think we can detect whether Cluster Bootstrap is actually enabled, since users may call `ClusterBootstrap(system).start()` whenever they like. Updated the logging to reflect that better. --- .../main/scala/akka/cluster/ClusterDaemon.scala | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/akka-cluster/src/main/scala/akka/cluster/ClusterDaemon.scala b/akka-cluster/src/main/scala/akka/cluster/ClusterDaemon.scala index 8361f5c4df..4ab23a3b0a 100644 --- a/akka-cluster/src/main/scala/akka/cluster/ClusterDaemon.scala +++ b/akka-cluster/src/main/scala/akka/cluster/ClusterDaemon.scala @@ -428,8 +428,8 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef, joinConfigCompatCh } if (seedNodes.isEmpty) { - if (isClusterBootstrapUsed) - logDebug("Cluster Bootstrap is used for joining") + if (isClusterBootstrapAvailable) + logInfo("No seed nodes found in configuration, relying on Cluster Bootstrap for joining") else logInfo( "No seed-nodes configured, manual cluster join required, see " + @@ -445,14 +445,8 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef, joinConfigCompatCh context.system.eventStream.subscribe(self, classOf[ClassicQuarantinedEvent]) } - private def isClusterBootstrapUsed: Boolean = { - val conf = context.system.settings.config - conf.hasPath("akka.management.cluster.bootstrap") && - conf.hasPath("akka.management.http.route-providers") && - conf - .getStringList("akka.management.http.route-providers") - .contains("akka.management.cluster.bootstrap.ClusterBootstrap$") - } + private def isClusterBootstrapAvailable: Boolean = + context.system.settings.config.hasPath("akka.management.cluster.bootstrap") override def postStop(): Unit = { context.system.eventStream.unsubscribe(self)