markusthoemmes commented on a change in pull request #2246: To resolve #2245 -
optimize container removal
URL:
https://github.com/apache/incubator-openwhisk/pull/2246#discussion_r116657394
##########
File path:
core/invoker/src/main/scala/whisk/core/containerpool/ContainerPool.scala
##########
@@ -192,13 +192,15 @@ object ContainerPool {
* takes away one of their containers iff the namespace placing the new
job is
* not already the most consuming one.
*
- * @param namespace the namespace that wants to get a container
+ * @param action the action that wants to get a container
+ * @param invocationNamespace the namespace, that wants to run the action
* @param pool a map of all containers in the pool
* @return a container to be removed iff found
*/
- def remove[A](invocationNamespace: EntityName, pool: Map[A, WorkerData]):
Option[A] = {
+ def remove[A](action: ExecutableWhiskAction, invocationNamespace:
EntityName, pool: Map[A, WorkerData]): Option[A] = {
+ //try to find a Free container that is initialized with any OTHER
action
val grouped = pool.collect {
- case (ref, WorkerData(w: WarmedData, _)) => ref -> w
+ case (ref, WorkerData(w: WarmedData, Free)) if (w.action != action
|| w.invocationNamespace != invocationNamespace) => ref -> w
Review comment:
Do we want to only collect `Free` containers? I'd claim no, since the
calculation below searches for the most consuming namespace. If that namespace
is inducing very high load, it can still monopolize the system if we are not
able to claim containers back because that namespace having only `Busy`
containers all the time.
----------------------------------------------------------------
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