Better warning message on cluster sharding registration (#24906)

* Better warning message on cluster sharding registration (#24295)

* Extra useful message

* Add [] in the log messages around membersByAge.head
This commit is contained in:
Richard Imaoka 2018-05-21 22:00:52 +09:00 committed by Konrad `ktoso` Malawski
parent 8c4181e552
commit 989a80d90f

View file

@ -673,10 +673,19 @@ private[akka] class ShardRegion(
def register(): Unit = {
coordinatorSelection.foreach(_ ! registrationMessage)
if (shardBuffers.nonEmpty && retryCount >= 5)
log.warning(
"Trying to register to coordinator at [{}], but no acknowledgement. Total [{}] buffered messages.",
coordinatorSelection, shardBuffers.totalSize)
if (shardBuffers.nonEmpty && retryCount >= 5) coordinatorSelection match {
case Some(actorSelection)
val coordinatorMessage =
if (cluster.state.unreachable(membersByAge.head)) s"Coordinator [${membersByAge.head}] is unreachable."
else s"Coordinator [${membersByAge.head}] is reachable."
log.warning(
"Trying to register to coordinator at [{}], but no acknowledgement. Total [{}] buffered messages. [{}]",
actorSelection, shardBuffers.totalSize, coordinatorMessage
)
case None log.warning(
"No coordinator found to register. Probably, no seed-nodes configured and manual cluster join not performed? Total [{}] buffered messages.",
shardBuffers.totalSize)
}
}
def registrationMessage: Any =