YAQL/Jinja function task() w/o arguments fails when a workflow is completing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mistral |
Fix Released
|
High
|
Renat Akhmerov |
Bug Description
The following workflow fails although must finish successfully:
wf:
tasks:
task1:
action: std.fail error_data="Some data"
on-error:
- task2: <% task().result != '' %>
task2:
action: std.noop
It fails with the error:
Can not evaluate YAQL expression [expression=
which means that it can't evaluate "task().result" at some point. However, if we use "task(task1)" then it finishes with SUCCESS.
It happens because the expression under "on-error" clause is evaluated not only when the task ends, but also when Mistral calculates the final workflow context by determining end tasks in each branch and merging their outbound contexts. But determining a end task in a branch involves evaluating expressions under "on-xxx" clauses again to see if there are subsequent tasks. So when it happens, the expression context is not prepared correctly.
Changed in mistral: | |
milestone: | none → train-1 |
assignee: | nobody → Renat Akhmerov (rakhmerov) |
importance: | Undecided → High |
status: | New → Confirmed |
tags: | added: backport stein |
Fix proposed to branch: master /review. openstack. org/651195
Review: https:/