openwhisk icon indicating copy to clipboard operation
openwhisk copied to clipboard

Improve message when activation is queried before action is run

Open ioana-blue opened this issue 9 years ago • 3 comments

I noticed the following behavior: I invoke an action (async) and immediately I ask for the logs. I get something like this:

./wsk action invoke slack-channels-info
ok: invoked slack-channels-info with id cb5930907976445aaebe4a5fd661d304
ioana@Ioanas-MBP:bin [ioana-slackbot]$ ./wsk activation logs cb5930907976445aaebe4a5fd661d304
error: The requested resource does not exist. (code 353)

The message is misleading, there is no error, it's just that the action was not run yet (it's pending). We should fix this message.

ioana-blue avatar May 10 '16 18:05 ioana-blue

The implementation does not create an activation resource until the activation is completed. So a GET for a "valid" activation id which is received as part of a non-blocking invoke will return 404 (Not Found) until the activation completes. The controller will need to create an activation resource for the id with an appropriate status (e.g., marked pending) field.

The CLI or UI could report a tip along the lines of "did you request an activation record for a recent activation that may not have finished? if so, try again" but we should just fix it at the controller level.

rabbah avatar May 10 '16 18:05 rabbah

I've also run into issues due to this design. There's a couple of use-cases where I'd like to be able to retrieve an activation record before it has finished....

  • Monitoring activation from non-blocking invoke. Currently you'd have to poll the record waiting for the 404 to disappear but it's a bit error prone in case the activation id was wrong.

  • Checking for in-flight activations. I have an action connected to a timer that varies in execution duration. If the action takes too long to execute, the next trigger will fire before it has finished. If I could check for in-flight activations, the next action could exit instead of running.

jthomas avatar Nov 23 '17 15:11 jthomas

Yes, I am also facing the same issue. It is really confusing.

image

shakshisinghai avatar Nov 19 '22 01:11 shakshisinghai