bdoyle0182 commented on code in PR #5287:
URL: https://github.com/apache/openwhisk/pull/5287#discussion_r1110465226


##########
core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/queue/MemoryQueue.scala:
##########
@@ -930,8 +930,16 @@ class MemoryQueue(private val etcdClient: EtcdClient,
       if (averageDurationBuffer.nonEmpty) {
         averageDuration = Some(averageDurationBuffer.average)
       }
+
       getUserLimit(invocationNamespace).andThen {
-        case Success(limit) =>
+        case Success(namespaceLimit) =>
+          // extra safeguard to use namespace limit if action limit exceeds 
due to namespace limit being lowered
+          // by operator after action is deployed
+          val actionLimit = actionMetaData.limits.containerConcurrency
+            .map(limit =>
+              if (limit.maxConcurrentContainers > namespaceLimit) 
ContainerConcurrencyLimit(namespaceLimit) else limit)
+            .getOrElse(ContainerConcurrencyLimit(namespaceLimit))

Review Comment:
   @style95 so I went a little different. I changed the api fields and db 
fields to be:
   
   ```
   concurrency
   instances
   ```
   
   I think this is sufficient in distinguishing the two mechanisms and they 
follow the same kind of verbiage for the api fields and keeps us from having to 
go through a whole api change process which I think can be avoided. I updated 
the code and documentation to refer to `concurrency` as intra concurrency 
including the swagger as well as the additions of this mr to 
`InstanceConcurrency` in code.
   
   The `concurrency` and `instances` field go into the `limits` section of the 
actions document / api so it should be self explanatory that they represent a 
max and is explained in the documentation.



-- 
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: issues-unsubscr...@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to