YAQL engine properties don't get initialized properly

Bug #1864785 reported by Renat Akhmerov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
High
Renat Akhmerov

Bug Description

When we launch Mistral with launch.py script then initialization of YAQL engine in the module yaql_expression.py happens before parsing the config file by oslo.cfg. This is because YAQL engine class is declared as a static module level variable (constant) and its initialization is caused by the chain if imports starting from launch.py module. However, parsing config file runs only in main() function of launch.py.

Changed in mistral:
milestone: none → ussuri-2
assignee: nobody → Renat Akhmerov (rakhmerov)
importance: Undecided → High
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (master)

Fix proposed to branch: master
Review: https://review.opendev.org/709951

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/709957

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.opendev.org/709951
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=753f1bc03fc5ae464d6a3c8266e025dce3cceccb
Submitter: Zuul
Branch: master

commit 753f1bc03fc5ae464d6a3c8266e025dce3cceccb
Author: Renat Akhmerov <email address hidden>
Date: Wed Feb 26 11:38:51 2020 +0700

    Fix YAQL engine initialization

    * When Mistral is launched via launch.py script then YAQL engine class
      initialization logic doesn't use the right properties from the config
      file. This is because this initialization is caused by the chain of
      imports taking its start in launch.py, and this happens before
      the config file is parsed in the main() function of launch.py.
      Using lazy initialization of YAQL engine class (YAQL_ENGINE in
      yaql_expression.py module) solves this issue because now Mistral
      doesn't initialize it immediately before parsing the config and
      waits for the first usage of it.
    * Minor style changes per Mistral coding guidelines.

    Change-Id: If3367493803b57ef8bc281b1f64f2a223ac86f85
    Closes-Bug: #1864785

Changed in mistral:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (stable/train)

Reviewed: https://review.opendev.org/709957
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=3df8162946144cda694ec6a750812a58e0ccfdf0
Submitter: Zuul
Branch: stable/train

commit 3df8162946144cda694ec6a750812a58e0ccfdf0
Author: Renat Akhmerov <email address hidden>
Date: Wed Feb 26 11:38:51 2020 +0700

    Fix YAQL engine initialization

    * When Mistral is launched via launch.py script then YAQL engine class
      initialization logic doesn't use the right properties from the config
      file. This is because this initialization is caused by the chain of
      imports taking its start in launch.py, and this happens before
      the config file is parsed in the main() function of launch.py.
      Using lazy initialization of YAQL engine class (YAQL_ENGINE in
      yaql_expression.py module) solves this issue because now Mistral
      doesn't initialize it immediately before parsing the config and
      waits for the first usage of it.
    * Minor style changes per Mistral coding guidelines.

    Change-Id: If3367493803b57ef8bc281b1f64f2a223ac86f85
    Closes-Bug: #1864785

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 10.0.0.0b3

This issue was fixed in the openstack/mistral 10.0.0.0b3 development milestone.

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.