tysonnorris commented on a change in pull request #2795: enable concurrent 
activation processing
URL: 
https://github.com/apache/incubator-openwhisk/pull/2795#discussion_r193925034
 
 

 ##########
 File path: 
core/invoker/src/main/scala/whisk/core/containerpool/ContainerProxy.scala
 ##########
 @@ -205,10 +213,35 @@ class ContainerProxy(
     // and we keep it in case we need to destroy it.
     case Event(data: PreWarmedData, _) => stay using data
 
-    // Run was successful
-    case Event(data: WarmedData, _) =>
+    // Init was successful
+    case Event(data: WarmedData, _: PreWarmedData) =>
+      //in case concurrency supported, multiple runs can begin as soon as init 
is complete
       context.parent ! NeedWork(data)
-      goto(Ready) using data
+      stay using data
+
+    // Run was successful
+    case Event(_: WarmedData, s: WarmedData) =>
+      val newData = s.decrementActive
+
+      context.parent ! NeedWork(newData)
+
+      if (newData.activeActivationCount > 0) {
+        stay using newData
+      } else {
+        logging.info(this, "going to ready after load completed")
+        goto(Ready) using newData
+      }
+
+    case Event(job: Run, data: WarmedData)
+        if stateData.activeActivationCount < poolConfig.maxConcurrent && 
!rescheduleJob => //if there was a delay, or a failure on resume, skip the run
 
 Review comment:
   These should be the same? I thought that data was only a matching 
convenience. Will change it but am curious if this is problematic?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to