chetanmeh commented on a change in pull request #4326: Invoker backpressure
URL: 
https://github.com/apache/incubator-openwhisk/pull/4326#discussion_r288402340
 
 

 ##########
 File path: 
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala
 ##########
 @@ -53,15 +58,25 @@ case class WorkerData(data: ContainerData, state: 
WorkerState)
  * @param feed actor to request more work from
  * @param prewarmConfig optional settings for container prewarming
  * @param poolConfig config for the ContainerPool
+ * @param resMgr ContainerResourceManager impl
  */
-class ContainerPool(childFactory: ActorRefFactory => ActorRef,
+class ContainerPool(instanceId: InvokerInstanceId,
+                    childFactory: ActorRefFactory => ActorRef,
                     feed: ActorRef,
                     prewarmConfig: List[PrewarmingConfig] = List.empty,
-                    poolConfig: ContainerPoolConfig)
+                    poolConfig: ContainerPoolConfig,
+                    resMgr: Option[ContainerResourceManager])
     extends Actor {
   import ContainerPool.memoryConsumptionOf
 
   implicit val logging = new AkkaLogging(context.system.log)
+  implicit val ec = context.dispatcher
+
+  val resourceManager = resMgr.getOrElse(if 
(poolConfig.clusterManagedResources) {
 
 Review comment:
   This looks bit convoluted. `ContainerPool` taken an optional 
`ContainerResourceManager` and if not supplied also instantiates it. So far I 
do not see that option being passed so its always the None case. May be its due 
to both `ContainerResourceManager` implementations needing access to pool actor 
reference.
   
   Instead of current approach it may be better to
   
   1. Do not allow passing an optional `ContainerResourceManager` and instead 
let `ContainerPool` create one 
   2. OR have a `ContainerResourceManagerFactory` which takes the `ActorRef` 
and creates one
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to