apache / apache/openwhisk

activation response for blocking invoke with active ack

Open
#1,144 4 comments 1 reaction 0 assignees View on GitHub
controller enhancement
Dominant language
Scala
Stars
6.8k
Forks
1.2k
Avg merge
2d 14h
Merged PRs (30d)
2

Description

Invoking an action with a blocking request
`wsk action invoke -b` will show empty log array if the response is from a fast path (aka active ack). This may cause confusion if the action is expected to produce some log messages. The reason is that we provide the response (result of the action) as soon as it is available and retrieve the logs separately.

```
> cat f.js
function main() {
console.log('hello world')
}
> wsk action create f f.js
ok: created action f
> wsk action invoke -b f
ok: invoked f with id ...
{
"activationId": "...",
"logs": [],
"name": "f",
"response": {
"result": {},
"status": "success",
"success": true
}, ...
}
```

The empty `logs` property is confusing. Proposal:

A. generate a stub log message e.g.,

```
"logs": [ "system message: check later for activation logs" ],
```

or B. strip `logs` out of the activation response,
or C. use an annotation to reflect the activation status (pending, running, waiting for logs, finished),
or D. use the `response.status` property to reflect status with more states

The logs must be retrieved via the `activations` API (`wsk activation get|poll` for example).

Related to #373.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the blocking `wsk action invoke -b` example and compare its response with logs retrieved through `wsk activation get` or `poll`. The issue presents several alternatives rather than a decided behavior; done requires an agreed response design that makes the active-ack and later log retrieval state clear.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.