YAQL evaluation of event types does not safe
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mistral |
New
|
Undecided
|
Unassigned |
Bug Description
The definitions from "event_
For example in the cases when the context of the event does not have a project attribute, the following definition will crash the thread and stops event processing. The events will be put to the queue but never processed becasue the thread is silently died [3]:
~~~~~~~~~~~~
- event_types:
- compute.*
properties:
payload: <% $.payload %>
project_id: <% $.context.project %>
user_id: <% $.context.user %>
~~~~~~~~~~~~
It is difficult to debug such a situation because of the error will be written to the stdout only during service shutdown but not when the issue has occurred. I think it is because of the threading nature of the event processing code.
As a workaround, I am using the get method for attributes:
~~~~~~~~~~~~
- event_types:
- compute.*
properties:
payload: <% $.get('payload') %>
project_id: <% $.context.
user_id: <% $.context.
~~~~~~~~~~~~
[1] https:/
[3] https:/