YAQL evaluation of event types does not safe

Bug #1857615 reported by ITD27M01
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
New
Undecided
Unassigned

Bug Description

The definitions from "event_definitions.yaml" [1] configuration file can lead to event processing thread crashes without any logs and notifications.

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.get('project') %>
    user_id: <% $.context.get('user') %>
~~~~~~~~~~~~

[1] https://github.com/openstack/mistral/blob/master/etc/event_definitions.yml.sample

[2] https://github.com/openstack/mistral/blob/541aabbfe8a7afd876adcfb209d18aafdef2d5f6/mistral/event_engine/default_event_engine.py#L73

[3] https://gist.github.com/ITD27M01/4330cca676a6fddad7e20f6c364d4832

ITD27M01 (igortiunov)
description: updated
ITD27M01 (igortiunov)
description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.