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/openwhisk.git
The following commit(s) were added to refs/heads/master by this push:
new 9fad23d Keep container running for truncated responses (#4754)
9fad23d is described below
commit 9fad23df483338f14aaa19869df1fae6b4dfb8cc
Author: dan mcweeney <[email protected]>
AuthorDate: Wed Dec 11 11:18:51 2019 -0500
Keep container running for truncated responses (#4754)
* Keep the container running even if the action produced a truncated
response.
---
.../main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala | 2 +-
.../scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala | 2 +-
.../org/apache/openwhisk/core/entity/test/ActivationResponseTests.scala | 2 +-
.../test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git
a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala
b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala
index 6d0085a..d3727c5 100644
---
a/common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala
+++
b/common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala
@@ -234,7 +234,7 @@ protected[core] object ActivationResponse extends
DefaultJsonProtocol {
}
case Some((length, maxlength)) =>
- developerError(truncatedResponse(str, length, maxlength),
Some(length.toBytes.toInt))
+ applicationError(JsString(truncatedResponse(str, length,
maxlength)), Some(length.toBytes.toInt))
}
case Left(_: MemoryExhausted) =>
diff --git
a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
index 570d61a..8010940 100644
---
a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
+++
b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
@@ -551,7 +551,7 @@ class ContainerProxy(factory: (TransactionId,
* 4. recording the result to the data store
*
* @param container the container to run the job on
- * @param job the job to run
+ * @param job the job to run
* @return a future completing after logs have been collected and
* added to the WhiskActivation
*/
diff --git
a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationResponseTests.scala
b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationResponseTests.scala
index 59ab350..bbfc197 100644
---
a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationResponseTests.scala
+++
b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ActivationResponseTests.scala
@@ -51,7 +51,7 @@ class ActivationResponseTests extends FlatSpec with Matchers {
{
val response = ContainerResponse(okStatus = true,
m.take(max.toBytes.toInt - 1), Some(m.length.B, max))
val run = processRunResponseContent(Right(response), logger)
- run.statusCode shouldBe DeveloperError
+ run.statusCode shouldBe ApplicationError
run.result.get.asJsObject
.fields(ERROR_FIELD) shouldBe truncatedResponse(response.entity,
m.length.B, max).toJson
}
diff --git
a/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala
b/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala
index b75fb7b..c8255e1 100644
---
a/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala
+++
b/tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala
@@ -313,7 +313,7 @@ class ActionLimitsTests extends TestHelpers with
WskTestHelpers with WskActorSys
def checkResponse(activation: ActivationResult) = {
val response = activation.response
response.success shouldBe false
- response.status shouldBe
ActivationResponse.messageForCode(ActivationResponse.DeveloperError)
+ response.status shouldBe
ActivationResponse.messageForCode(ActivationResponse.ApplicationError)
val msg =
response.result.get.fields(ActivationResponse.ERROR_FIELD).convertTo[String]
val expected = Messages.truncatedResponse((allowedSize + 10).B,
allowedSize.B)
withClue(s"is: ${msg.take(expected.length)}\nexpected: $expected") {