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


##########
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:
   I agree but that's going to be a breaking change for the existing users of 
it. Is there a way we could add another new field that maps to the same field 
stored in the db? I guess I just don't want to have to change the api.
   
   I could rename it to `ActionInstanceLimit`? And rename the existing Limit 
case class to `ActionIntraConcurrencyLimit`.
   
   However the api would have to remain the same such that the two fields the 
user supplies on the api would be 
   ```
   concurrency
   instanceConcurrency
   ```
   
   or I could add a third field to the api such that there's these field 
options on the action put
   ```
   concurrency
   intraConcurrency
   instanceConcurrency
   ```
   
   where if both `intraConcurrency` and `concurrency` are defined, 
`concurrency` is ignored and `intraConcurrency` takes precedence as the value 
that's used in the service. I could make it such that if you try to upload with 
both fields the api rejects, and any new uploads of actions with either field 
defined writes to `intraConcurrency` in the db and removes `concurrency` from 
the document if it exists.
   
   
   thoughts?



-- 
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