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.
This commit is contained in:
Arnout Engelen 2020-12-09 17:29:06 +01:00 committed by GitHub
parent 9416dedad7
commit 4785ed1b48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)