Skip to content

Commit 729cb2c

Browse files
cbickelrabbah
authored andcommitted
Always return activation without log on blocking invoke. (#4100)
If a user invokes a blocking action today, the invoker executes the activation and sends back the result to the controller, which passes it back to the client. If it is not possible to pass the result back to the controller, the controller will try to get the result from the database. And here's the problem. If the controller receives the result of the activation from the invoker, there are no logs included. If it polls it from the database, the logs are included. This should be unified to never return logs.
1 parent f47410d commit 729cb2c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ protected[actions] trait PrimitiveActions {
631631
LoggingMarkers.CONTROLLER_ACTIVATION_BLOCKING_DATABASE_RETRIEVAL,
632632
s"retrieved activation for blocking invocation via DB polling",
633633
logLevel = InfoLevel)
634-
result.trySuccess(Right(activation))
634+
result.trySuccess(Right(activation.withoutLogs))
635635
case Failure(_: NoDocumentException) => pollActivation(docid, context, result, wait, retries + 1, maxRetries)
636636
case Failure(t: Throwable) => result.tryFailure(t)
637637
}

tests/src/test/scala/whisk/core/controller/test/ActionsApiTests.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,8 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
12711271
activationIdFactory.make(),
12721272
start = Instant.now,
12731273
end = Instant.now,
1274-
response = ActivationResponse.success(Some(JsObject("test" -> "yes".toJson))))
1274+
response = ActivationResponse.success(Some(JsObject("test" -> "yes".toJson))),
1275+
logs = ActivationLogs(Vector("first line", "second line")))
12751276
put(entityStore, action)
12761277
// storing the activation in the db will allow the db polling to retrieve it
12771278
// the test harness makes sure the activation id observed by the test matches

0 commit comments

Comments
 (0)