Update links to Lightbend RPv2, more warnings about auto-down
This commit is contained in:
parent
ee116dcdab
commit
0a75f992e4
12 changed files with 72 additions and 39 deletions
|
|
@ -26,6 +26,10 @@ akka {
|
|||
# unreachable nodes as DOWN after a configured time of unreachability?
|
||||
# Using auto-down implies that two separate clusters will automatically be
|
||||
# formed in case of network partition.
|
||||
#
|
||||
# Don't enable this in production, see 'Auto-downing (DO NOT USE)' section
|
||||
# of Akka Cluster documentation.
|
||||
#
|
||||
# Disable with "off" or specify a duration to enable auto-down.
|
||||
# If a downing-provider-class is configured this setting is ignored.
|
||||
auto-down-unreachable-after = off
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import scala.concurrent.duration.FiniteDuration
|
|||
import akka.cluster.ClusterEvent._
|
||||
|
||||
import scala.concurrent.duration.Duration
|
||||
import akka.actor.ActorLogging
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
@ -51,7 +52,7 @@ final class AutoDowning(system: ActorSystem) extends DowningProvider {
|
|||
* able to unit test the logic without running cluster.
|
||||
*/
|
||||
private[cluster] class AutoDown(autoDownUnreachableAfter: FiniteDuration)
|
||||
extends AutoDownBase(autoDownUnreachableAfter) {
|
||||
extends AutoDownBase(autoDownUnreachableAfter) with ActorLogging {
|
||||
|
||||
val cluster = Cluster(context.system)
|
||||
import cluster.InfoLogger._
|
||||
|
|
@ -62,6 +63,8 @@ private[cluster] class AutoDown(autoDownUnreachableAfter: FiniteDuration)
|
|||
|
||||
// re-subscribe when restart
|
||||
override def preStart(): Unit = {
|
||||
log.warning("Don't use auto-down feature of Akka Cluster in production. " +
|
||||
"See 'Auto-downing (DO NOT USE)' section of Akka Cluster documentation.")
|
||||
cluster.subscribe(self, classOf[ClusterDomainEvent])
|
||||
super.preStart()
|
||||
}
|
||||
|
|
@ -72,7 +75,9 @@ private[cluster] class AutoDown(autoDownUnreachableAfter: FiniteDuration)
|
|||
|
||||
override def down(node: Address): Unit = {
|
||||
require(leader)
|
||||
logInfo("Leader is auto-downing unreachable node [{}]", node)
|
||||
logInfo("Leader is auto-downing unreachable node [{}]. " +
|
||||
"Don't use auto-down feature of Akka Cluster in production. " +
|
||||
"See 'Auto-downing (DO NOT USE)' section of Akka Cluster documentation.", node)
|
||||
cluster.down(node)
|
||||
}
|
||||
|
||||
|
|
@ -162,4 +167,4 @@ private[cluster] abstract class AutoDownBase(autoDownUnreachableAfter: FiniteDur
|
|||
pendingUnreachable -= node
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue