Skip to content

Commit

Permalink
Remove cluster creation from ShardingContainerPoolBalancer
Browse files Browse the repository at this point in the history
  • Loading branch information
hunhoffe authored and hunhoffe committed Jul 25, 2022
1 parent c6284af commit c04a9b4
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import java.util.concurrent.ThreadLocalRandom
import akka.actor.{Actor, ActorSystem, Cancellable, Props}
import akka.cluster.ClusterEvent._
import akka.cluster.{Cluster, Member, MemberStatus}
import akka.management.scaladsl.AkkaManagement
import akka.management.cluster.bootstrap.ClusterBootstrap
import org.apache.openwhisk.common.InvokerState.{Healthy, Offline, Unhealthy, Unresponsive}
import pureconfig._
import pureconfig.generic.auto._
Expand Down Expand Up @@ -154,11 +152,7 @@ class ShardingContainerPoolBalancer(
extends CommonLoadBalancer(config, feedFactory, controllerInstance) {

/** Build a cluster of all loadbalancers */
private val cluster: Option[Cluster] = if (loadConfigOrThrow[ClusterConfig](ConfigKeys.cluster).useClusterBootstrap) {
AkkaManagement(actorSystem).start()
ClusterBootstrap(actorSystem).start()
Some(Cluster(actorSystem))
} else if (loadConfigOrThrow[Seq[String]]("akka.cluster.seed-nodes").nonEmpty) {
private val cluster: Option[Cluster] = if (loadConfigOrThrow[ClusterConfig](ConfigKeys.cluster).useClusterBootstrap || loadConfigOrThrow[Seq[String]]("akka.cluster.seed-nodes").nonEmpty) {
Some(Cluster(actorSystem))
} else {
None
Expand Down

0 comments on commit c04a9b4

Please sign in to comment.