tysonnorris commented on a change in pull request #4186: Track activation
counts in ContainerPool (not ContainerProxy)
URL:
https://github.com/apache/incubator-openwhisk/pull/4186#discussion_r250069059
##########
File path:
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala
##########
@@ -342,12 +380,35 @@ object ContainerPool {
protected[containerpool] def schedule[A](action: ExecutableWhiskAction,
invocationNamespace: EntityName,
idles: Map[A, ContainerData]):
Option[(A, ContainerData)] = {
- idles.find {
- case (_, WarmedData(_, `invocationNamespace`, `action`, _,
activeActivationCount))
- if activeActivationCount < action.limits.concurrency.maxConcurrent =>
- true
- case _ => false
- }
+ idles
Review comment:
I think `toSeq` in your example will only have the element of the `Option`
result of `find()` (single element), so I'm not sure that will work.
I think `find` is good here, compared to `filter`, but I think having 3
finds with different types is more clear than having an "order". `collect` may
work too, but I think will have the same negative impact as `filter`, where
every match is collected (while we only want the first).
I reorganized a bit, in any case.
----------------------------------------------------------------
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