You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/01/26 13:59:16 UTC
[GitHub] markusthoemmes closed pull request #3221: Fix overload of invoker.
markusthoemmes closed pull request #3221: Fix overload of invoker.
URL: https://github.com/apache/incubator-openwhisk/pull/3221
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/core/controller/src/main/scala/whisk/core/loadBalancer/ContainerPoolBalancer.scala b/core/controller/src/main/scala/whisk/core/loadBalancer/ContainerPoolBalancer.scala
index f2614e0ca2..aed332e95b 100644
--- a/core/controller/src/main/scala/whisk/core/loadBalancer/ContainerPoolBalancer.scala
+++ b/core/controller/src/main/scala/whisk/core/loadBalancer/ContainerPoolBalancer.scala
@@ -43,9 +43,9 @@ import scala.util.{Failure, Success}
case class LoadbalancerConfig(blackboxFraction: Double, invokerBusyThreshold: Int)
-class ContainerPoolBalancer(config: WhiskConfig, instance: InstanceId)(implicit val actorSystem: ActorSystem,
- logging: Logging,
- materializer: ActorMaterializer)
+class ContainerPoolBalancer(config: WhiskConfig, controllerInstance: InstanceId)(implicit val actorSystem: ActorSystem,
+ logging: Logging,
+ materializer: ActorMaterializer)
extends LoadBalancer {
private val lbConfig = loadConfigOrThrow[LoadbalancerConfig](ConfigKeys.loadbalancer)
@@ -219,7 +219,7 @@ class ContainerPoolBalancer(config: WhiskConfig, instance: InstanceId)(implicit
private val invokerPool = {
// Do not create the invokerPool if it is not possible to create the health test action to recover the invokers.
InvokerPool
- .healthAction(instance)
+ .healthAction(controllerInstance)
.map {
// Await the creation of the test action; on failure, this will abort the constructor which should
// in turn abort the startup of the controller.
@@ -233,9 +233,9 @@ class ContainerPoolBalancer(config: WhiskConfig, instance: InstanceId)(implicit
val maxPingsPerPoll = 128
val pingConsumer =
- messagingProvider.getConsumer(config, s"health${instance.toInt}", "health", maxPeek = maxPingsPerPoll)
+ messagingProvider.getConsumer(config, s"health${controllerInstance.toInt}", "health", maxPeek = maxPingsPerPoll)
val invokerFactory = (f: ActorRefFactory, invokerInstance: InstanceId) =>
- f.actorOf(InvokerActor.props(invokerInstance, instance))
+ f.actorOf(InvokerActor.props(invokerInstance, controllerInstance))
actorSystem.actorOf(
InvokerPool.props(invokerFactory, (m, i) => sendActivationToInvoker(messageProducer, m, i), pingConsumer))
@@ -248,7 +248,11 @@ class ContainerPoolBalancer(config: WhiskConfig, instance: InstanceId)(implicit
val maxActiveAcksPerPoll = 128
val activeAckPollDuration = 1.second
private val activeAckConsumer =
- messagingProvider.getConsumer(config, "completions", s"completed${instance.toInt}", maxPeek = maxActiveAcksPerPoll)
+ messagingProvider.getConsumer(
+ config,
+ "completions",
+ s"completed${controllerInstance.toInt}",
+ maxPeek = maxActiveAcksPerPoll)
val activationFeed = actorSystem.actorOf(Props {
new MessageFeed(
"activeack",
@@ -299,7 +303,7 @@ class ContainerPoolBalancer(config: WhiskConfig, instance: InstanceId)(implicit
val invokersToUse = if (action.exec.pull) blackboxInvokers(invokers) else managedInvokers(invokers)
val invokersWithUsage = invokersToUse.view.map {
// Using a view defers the comparably expensive lookup to actual access of the element
- case invoker => (invoker.id, invoker.status, currentActivations.getOrElse(instance.toString, 0))
+ case invoker => (invoker.id, invoker.status, currentActivations.getOrElse(invoker.id.toString, 0))
}
ContainerPoolBalancer.schedule(invokersWithUsage, lbConfig.invokerBusyThreshold, hash) match {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services