You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ma...@apache.org on 2017/07/17 06:24:26 UTC

[incubator-openwhisk] branch master updated: Let each controller create its own health action (#2456)

This is an automated email from the ASF dual-hosted git repository.

markusthoemmes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 67ad1b1  Let each controller create its own health action (#2456)
67ad1b1 is described below

commit 67ad1b15471a32fb0a85ea3f2f97fafe48574847
Author: Christian Bickel <gi...@cbickel.de>
AuthorDate: Mon Jul 17 08:24:24 2017 +0200

    Let each controller create its own health action (#2456)
---
 .../src/main/scala/whisk/core/loadBalancer/InvokerSupervision.scala | 6 +++---
 .../main/scala/whisk/core/loadBalancer/LoadBalancerService.scala    | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/core/controller/src/main/scala/whisk/core/loadBalancer/InvokerSupervision.scala b/core/controller/src/main/scala/whisk/core/loadBalancer/InvokerSupervision.scala
index 79eb76b..7fefb87 100644
--- a/core/controller/src/main/scala/whisk/core/loadBalancer/InvokerSupervision.scala
+++ b/core/controller/src/main/scala/whisk/core/loadBalancer/InvokerSupervision.scala
@@ -177,10 +177,10 @@ object InvokerPool {
     }
 
     /** An action to use for monitoring invoker health. */
-    val healthAction = ExecManifest.runtimesManifest.resolveDefaultRuntime("nodejs:6").map { manifest =>
+    def healthAction(i: InstanceId) = ExecManifest.runtimesManifest.resolveDefaultRuntime("nodejs:6").map { manifest =>
         new WhiskAction(
             namespace = healthActionIdentity.namespace.toPath,
-            name = EntityName("invokerHealthTestAction"),
+            name = EntityName(s"invokerHealthTestAction${i.toInt}"),
             exec = new CodeExecAsString(manifest, """function main(params) { return params; }""", None))
     }
 }
@@ -301,7 +301,7 @@ class InvokerActor(controllerInstance: InstanceId) extends FSM[InvokerState, Inv
      * The InvokerPool redirects it to the invoker which is represented by this InvokerActor.
      */
     private def invokeTestAction() = {
-        InvokerPool.healthAction.map { action =>
+        InvokerPool.healthAction(controllerInstance).map { action =>
             val activationMessage = ActivationMessage(
                 // Use the sid of the InvokerSupervisor as tid
                 transid = transid,
diff --git a/core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala b/core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala
index b5d8207..cdf16a3 100644
--- a/core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala
+++ b/core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala
@@ -221,7 +221,7 @@ class LoadBalancerService(
 
     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.map {
+        InvokerPool.healthAction(instance).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.
             a => Await.result(createTestActionForInvokerHealth(entityStore, a), 1.minute)

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].