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/11/28 10:40:47 UTC

[GitHub] cbickel commented on a change in pull request #4137: Remove busy loop in case the invoker is overloaded.

cbickel commented on a change in pull request #4137: Remove busy loop in case the invoker is overloaded.
URL: https://github.com/apache/incubator-openwhisk/pull/4137#discussion_r237028430
 
 

 ##########
 File path: core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala
 ##########
 @@ -99,13 +99,16 @@ class ContainerPool(childFactory: ActorRefFactory => ActorRef,
     // their requests and send them back to the pool for rescheduling (this may happen if "docker" operations
     // fail for example, or a container has aged and was destroying itself when a new request was assigned)
     case r: Run =>
-      // Check if the message is resent from the buffer. Only the first message on the buffer can be resent.
-      val isResentFromBuffer = runBuffer.nonEmpty && runBuffer.dequeueOption.exists(_._1.msg == r.msg)
+      // Checks if the current message is the first in the queue
+      val isFirstInQueue = runBuffer.dequeueOption.exists(_._1.msg == r.msg)
+      // A resend is only valid, if the message is the first one in the queue. Otherwise it is a result of a race condition.
+      val isValidResent = r.fromQueue && isFirstInQueue
 
 Review comment:
   I also thought about this after I was finished.
   The only concern with this that came into my mind was, that one more message is sent for every activation. But I don't think, that this will be a bottleneck.
   I think it's worth this change to get the code more clear.

----------------------------------------------------------------
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