style95 commented on code in PR #5344:
URL: https://github.com/apache/openwhisk/pull/5344#discussion_r1006487212


##########
core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/SchedulingDecisionMaker.scala:
##########
@@ -139,9 +139,9 @@ class SchedulingDecisionMaker(
           case (Running, Some(duration)) if staleActivationNum > 0 =>
             // we can safely get the value as we already checked the existence
             val containerThroughput = staleThreshold / duration
-            val num = ceiling(availableMsg.toDouble / containerThroughput)
+            val num = ceiling(staleActivationNum.toDouble / 
containerThroughput)
             // if it tries to create more containers than existing messages, 
we just create shortage
-            val actualNum = (if (num > availableMsg) availableMsg else num) - 
inProgress
+            val actualNum = (if (num > staleActivationNum) staleActivationNum 
else num) - inProgress

Review Comment:
   I still believe we need to consider all available messages.
   This is because there can be both stale activations and non-stale(but about 
to be staled) activations.
   It takes some time to provision more containers. Even if we can add more 
containers based on stale activations but we would easily need to add more 
containers if the container throughput itself is not enough.
   To avoid too much over-provision, I think we can just substitute `existing` 
as well.
   
   ``` 
   val actualNum = (if (num > availableMsg) availableMsg else num) - inProgress 
- existing
   ```
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to