rabbah commented on a change in pull request #2658: Treat a timed out active 
ack as failed activation in invokerhealth protocol
URL: 
https://github.com/apache/incubator-openwhisk/pull/2658#discussion_r140472736
 
 

 ##########
 File path: 
core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala
 ##########
 @@ -125,18 +125,34 @@ class LoadBalancerService(config: WhiskConfig, instance: 
InstanceId, entityStore
    */
   private def processCompletion(response: Either[ActivationId, 
WhiskActivation],
                                 tid: TransactionId,
-                                forced: Boolean): Unit = {
+                                forced: Boolean,
+                                invoker: InstanceId): Unit = {
     val aid = response.fold(l => l, r => r.activationId)
+
+    // treat left as success (as it is the result a the message exceeding the 
bus limit)
+    // treat timed out active ack as failure to let the invoker become 
unhealthy
+    val isSuccess = response.fold(l => true, r => !r.response.isWhiskError)
+
     loadBalancerData.removeActivation(aid) match {
       case Some(entry) =>
         logging.info(this, s"${if (!forced) "received" else "forced"} active 
ack for '$aid'")(tid)
+        // If we receive an active ack (forced = false) we send the 
activationResult. If the timeout
+        // is executed earlier, we treat the activation as failed (forced = 
true).
+        // At this point no health actions are handled, because they don't 
have an entry in loadBalancerData.
+        invokerPool ! InvocationFinishedMessage(invoker, isSuccess && !forced)
 
 Review comment:
   slight rewording for clarity:
   
   Active acks that are received here are strictly from user actions - health 
actions are not part of the load balancer's activation map. Inform the invoker 
pool supervisor of the user action completion. If the active ack was forced, 
because the waiting period expired, treat it as a failed activation. A cluster 
of such failures will eventually turn the invoker unhealthy and suspend queuing 
activations to that invoker topic.
 
----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to