rabbah commented on a change in pull request #2421: Fix order of messages being 
sent by the ContainerPool.
URL: 
https://github.com/apache/incubator-openwhisk/pull/2421#discussion_r124445786
 
 

 ##########
 File path: 
core/invoker/src/main/scala/whisk/core/dispatcher/ActivationFeed.scala
 ##########
 @@ -103,14 +110,29 @@ protected class ActivationFeed(
             } else logging.debug(this, "dropping fill request until feed is 
drained")
 
         case n: ActivationNotification =>
+            downstreamCapacity += 1
             pipelineOccupancy -= 1
             logging.info(this, s"received ActivationNotification: $n / 
pipelineOccupancy=$pipelineOccupancy / 
pipelineFillThreshold=$pipelineFillThreshold")
             if (pipelineOccupancy < 0) {
                 logging.error(this, "pipelineOccupancy<0")
             }
+            send()
             fill()
     }
 
+    /** Send as many messages as we're allowed to, or as we have depending on 
what happens first. */
+    @tailrec
+    private def send(): Unit = {
+        if (downstreamCapacity > 0 && outstanding.size > 0) {
+            downstreamCapacity -= 1
 
 Review comment:
   it seems unnecessary to had a pipeline capacity and in the presence of an 
internal buffer - the size of the buffer is the pipeline capacity.
   
 
----------------------------------------------------------------
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