You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by "style95 (via GitHub)" <gi...@apache.org> on 2023/02/18 09:46:11 UTC

[GitHub] [openwhisk] style95 commented on a diff in pull request #5287: User Defined Action Instance Concurrency Limits

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


##########
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:
   Yeah, that would be better 👍 



-- 
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-unsubscribe@openwhisk.apache.org

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