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 2020/03/12 17:52:50 UTC

[GitHub] [openwhisk] rabbah commented on a change in pull request #4858: Controller endpoint for checking the controller readiness

rabbah commented on a change in pull request #4858: Controller endpoint for checking the controller readiness
URL: https://github.com/apache/openwhisk/pull/4858#discussion_r391793249
 
 

 ##########
 File path: core/controller/src/main/scala/org/apache/openwhisk/core/controller/Controller.scala
 ##########
 @@ -151,6 +153,16 @@ class Controller(val instance: ControllerInstanceId,
             .invokerHealth()
             .map(_.count(_.status == InvokerState.Healthy).toJson)
         }
+      } ~ path("ready") {
+        onSuccess(loadBalancer.invokerHealth()) { invokersHealth =>
+          val all = invokersHealth.size
+          val healthy = invokersHealth.count(_.status == InvokerState.Healthy)
+          val ready = Controller.readyState(all, healthy, Controller.readinessThreshold.getOrElse(1))
+          if (ready)
+            complete(s"healthy $healthy/$all")
 
 Review comment:
   can you make these a JSON response for consistency with all controller responses?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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