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


##########
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:
   Yes, that sounds good to me.
   So we can support both `concurrency` and `intraConcurrency` for a while and 
finally remove `concurrency` from API at some point.
   The `instanceConcurrency` is a newly added field.
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to