Today we create activation records for triggers regardless of a matching rule. This can lead to many trigger activations that are not actually doing anything useful. The system incurs the cost of creating the activation record and no actions are run.
On the one hand, it's useful to see a trigger activation records when one creates a trigger and just fires it to get an activation id. But the cost for supporting this is too high in general. I am proposing only creating an activation record for a trigger if there is a rule matched (and hence an action is invoked). This will reduce the load on the system in terms of useless events (establishing an event source but not creating any actions to react to them). 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. I'd like to consider this as a first step as part of a larger item that can be encompassed by https://github.com/apache/incubator-openwhisk/issues/512. A subsequent step that I'd like to propose is to eliminate the separate rule activation record. Instead, the controller should record the matched rules in the trigger activation record (either as synthetic logs akin to sequences or as annotations) along with the activation ids of all caused invocations. Currently there is no visibility to the client in terms of the activations ids that are caused by a rule, and this leads to a poor user experience. In turn, this will also reduce the activations load on the database from the controller, and more importantly allow the client to have visibility into event causality. I welcome feedback on this topic and will consolidate feedback into the issue cited above for implementation. -r