You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ty...@apache.org on 2018/12/07 05:08:56 UTC

[incubator-openwhisk] branch master updated: Concurrency limit updates (#4160)

This is an automated email from the ASF dual-hosted git repository.

tysonnorris pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 1821689  Concurrency limit updates (#4160)
1821689 is described below

commit 18216894f6602f1155353e9227aaf7e95740921f
Author: tysonnorris <ty...@gmail.com>
AuthorDate: Thu Dec 6 21:08:50 2018 -0800

    Concurrency limit updates (#4160)
    
    * propagate concurrency limits during action update
---
 .../org/apache/openwhisk/core/controller/Actions.scala  |  3 ++-
 .../core/controller/test/ActionsApiTests.scala          | 17 +++++++++++++++--
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala
index eca0176..3587a7e 100644
--- a/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala
+++ b/core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala
@@ -486,7 +486,8 @@ trait WhiskActionsApi extends WhiskCollectionAPI with PostActionActivation with
       ActionLimits(
         l.timeout getOrElse action.limits.timeout,
         l.memory getOrElse action.limits.memory,
-        l.logs getOrElse action.limits.logs)
+        l.logs getOrElse action.limits.logs,
+        l.concurrency getOrElse action.limits.concurrency)
     } getOrElse action.limits
 
     // This is temporary while we are making sequencing directly supported in the controller.
diff --git a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala
index 4d98aa1..d2d6387 100644
--- a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala
+++ b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala
@@ -1176,8 +1176,16 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
 
   it should "update action with a put" in {
     implicit val tid = transid()
-    val action = WhiskAction(namespace, aname(), jsDefault("??"), Parameters("x", "b"))
-    val content = WhiskActionPut(Some(jsDefault("_")), Some(Parameters("x", "X")))
+    val action = WhiskAction(namespace, aname(), jsDefault("??"), Parameters("x", "b"), ActionLimits())
+    val content = WhiskActionPut(
+      Some(jsDefault("_")),
+      Some(Parameters("x", "X")),
+      Some(
+        ActionLimitsOption(
+          Some(TimeLimit(TimeLimit.MAX_DURATION)),
+          Some(MemoryLimit(MemoryLimit.maxMemory)),
+          Some(LogLimit(LogLimit.maxLogSize)),
+          Some(ConcurrencyLimit(ConcurrencyLimit.maxConcurrent)))))
     put(entityStore, action)
     Put(s"$collectionPath/${action.name}?overwrite=true", content) ~> Route.seal(routes(creds)) ~> check {
       deleteAction(action.docid)
@@ -1189,6 +1197,11 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
           action.name,
           content.exec.get,
           content.parameters.get,
+          ActionLimits(
+            content.limits.get.timeout.get,
+            content.limits.get.memory.get,
+            content.limits.get.logs.get,
+            content.limits.get.concurrency.get),
           version = action.version.upPatch,
           annotations = action.annotations ++ Parameters(WhiskAction.execFieldName, NODEJS6))
       }