Skip to content

Commit

Permalink
Always return activation without log on blocking invoke. (apache#4100)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cbickel authored and rabbah committed Nov 6, 2018
1 parent f57611b commit ab11dc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ protected[actions] trait PrimitiveActions {
LoggingMarkers.CONTROLLER_ACTIVATION_BLOCKING_DATABASE_RETRIEVAL,
s"retrieved activation for blocking invocation via DB polling",
logLevel = InfoLevel)
result.trySuccess(Right(activation))
result.trySuccess(Right(activation.withoutLogs))
case Failure(_: NoDocumentException) => pollActivation(docid, context, result, wait, retries + 1, maxRetries)
case Failure(t: Throwable) => result.tryFailure(t)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,8 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
activationIdFactory.make(),
start = Instant.now,
end = Instant.now,
response = ActivationResponse.success(Some(JsObject("test" -> "yes".toJson))))
response = ActivationResponse.success(Some(JsObject("test" -> "yes".toJson))),
logs = ActivationLogs(Vector("first line", "second line")))
put(entityStore, action)
// storing the activation in the db will allow the db polling to retrieve it
// the test harness makes sure the activation id observed by the test matches
Expand Down

0 comments on commit ab11dc0

Please sign in to comment.