Folks, I wanted to let you all know about a couple PRs [1] [2] that implement more of Rodric's proposal [3] to reduce unnecessary activation records. These PRs will update trigger fire behavior as follows: - [1] Only create a trigger activation record for a trigger if there is at least one active rule matched (and hence an action is invoked).
- [1] Update the trigger activation record to include a "logs" field, which will be an array of JSON objects - with each object representing the action's non-blocking invocation results. For example: "logs": [ {"statusCode":0, "success":true, "activationId":"ae2d98c6b49b4a32ad98c6b49bba32c5", "rule":"guest/wrule", "action": "guest/echo-env-web"}, {"statusCode":0, "success":true, "activationId":"32e3afff8a7f4c31a3afff8a7fbc319b", "rule":"guest/wrule2", "action":"guest/echo-env-web"}, {"statusCode":1, "success":false, "rule":"guest/wrule3", "error":"The requested resource does not exist.", "action": "guest/nonexistent-action"} ], - [2] Return a 204 (no activation id payload) when a trigger is fired and it has no active rules. - [2] Update trigger activation "logs" field to include any inactive matched rules; however, there must be at least on active matched rule to create the activation record. Minor changes to the "wsk" CLI will follow to handle trigger fire responses without activation ids. [1] https://github.com/apache/incubator-openwhisk/pull/3187 [2] https://github.com/apache/incubator-openwhisk/pull/3262 [3] http://mail-archives.apache.org/mod_mbox/incubator-openwhisk-dev/201711.mbox/%3CCAAC1_d5KduPSFqqa7dMhbY5DS3u%3DN42%2BkjZw3EXAo_mZfscbpw%40mail.gmail.com%3E Thanks, Mark Deuser From: Rodric Rabbah <rod...@gmail.com> To: dev@openwhisk.apache.org Date: 12/05/2017 11:20 AM Subject: Re: proposal to remove trigger activations when no rules are matched Thanks Mark for picking this up. For the interested and future reference, this is a sketch of the implementation that aligns with the proposal https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_incubator-2Dopenwhisk_compare_master...rabbah-3Atrigger-2Dactivations-3Fexpand-3D1&d=DwIBaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=wYdq-dij7_8AYSSwNtXu9w38EX035p590rSHy7Q_A2M&m=b-QMZ4_8-EUF7VBhZHaX0WRMEqfZdv6Zww3tAKRAAVo&s=mEaCW0SflGMFEAtHcYRG-Zr5LRmJe2SjM_P94WirRMU&e= -r On Tue, Dec 5, 2017 at 10:17 AM, Mark Deuser <mdeu...@us.ibm.com> wrote: > As part of the implementation of Rodric's proposal, a PR [1] has been > submitted to the change the trigger fire API as follows: > - The trigger activation record will now be persisted asynchronously > - A 202 is returned instead of 200. The activation id ("activationId") > continues to be returned in the body as before. > > This means that immediately after firing a trigger, the corresponding > trigger activation may not yet be accessible - similar to today's > asynchronous action invocation behavior. > > [1] https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_incubator-2Dopenwhisk_pull_3031&d=DwIBaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=wYdq-dij7_8AYSSwNtXu9w38EX035p590rSHy7Q_A2M&m=b-QMZ4_8-EUF7VBhZHaX0WRMEqfZdv6Zww3tAKRAAVo&s=f1LfTbxx6x2KgZWin4IfcyOUWdhJluLxFLWtxrOAsj4&e= > > Thanks, > Mark Deuser > > On 2017-11-14 14:47, Rodric Rabbah <r...@gmail.com> wrote: > > > > This will require an API change: when a trigger is fired (assuming it> > > exists, and the subject is authorized to fire it), today the controller> > > > will return 200 OK and an activation id. I propose instead to change > the> > > status code should to 202 Accepted if and only if the trigger has a> > > corresponding active rule, an 204 No Content otherwise.> > > > > >