Mistral workflow including 'with-items' is not starting on-success task
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mistral |
Fix Released
|
Critical
|
Unassigned |
Bug Description
How to reproduce:
1. Create workflow
$ cat simple-
---
version: '2.0'
simple-workflow:
description: foo
type: direct
output:
out: <% $.out2 %>
tasks:
task1:
action: std.echo output=<% $.x %>
- task2
task2:
action: std.echo output=<% $.y %>
2. Run workflow and see it execution status
$ mistral execution-create simple-workflow
+------
| Field | Value |
+------
| ID | c9fb2534-
| Workflow | simple-workflow |
| Description | |
| State | RUNNING |
| State info | None |
| Created at | 2016-01-19 10:45:50 |
| Updated at | 2016-01-19 10:45:50 |
+------
$ mistral execution-get c9fb2534-
+------
| Field | Value |
+------
| ID | c9fb2534-
| Workflow | simple-workflow |
| Description | |
| State | SUCCESS |
| State info | None |
| Created at | 2016-01-19 10:45:50 |
| Updated at | 2016-01-19 10:45:53 |
+------
Result: Workflow is in SUCCESS state, but it didn't run task2. Also, output from workflow is corrupted
$ mistral task-list
+------
| ID | Name | Workflow name | Execution ID | State | State info |
+------
| 75ea9f66-
+------
$ mistral execution-
{
"out": "<% $.out2 %>"
}
Expected result: All task from workflow are beeing run
Changed in mistral: | |
milestone: | none → mitaka-3 |
importance: | Undecided → Critical |
Changed in mistral: | |
milestone: | mitaka-3 → 2.0.0 |
Reviewed: https:/ /review. openstack. org/273579 /git.openstack. org/cgit/ openstack/ mistral/ commit/ ?id=d9b2fb7cd34 d6aa26a5c1d71cc 80ec4a1ac2ffd3
Committed: https:/
Submitter: Jenkins
Branch: master
commit d9b2fb7cd34d6aa 26a5c1d71cc80ec 4a1ac2ffd3
Author: Dawid Deja <email address hidden>
Date: Mon Feb 1 13:17:52 2016 +0100
Fix for not running 'on-success' task after task with 'with-items'
The following bug is caused by using READ_COMMITTED transaction level. When
2 actions are running simultanously, this is what happen in default engine
when on_action_complete is called:
1. Action1 is marked as 'Success'; engine checks if Task1 has ended (it
has not, since there is still Action2);
2. Action2 is marked as 'Success'; engine checks if Task1 has ended (it
has, both actions has been marked as 'Success');
3. Action1 enters second transaction and checks if Task1 has ended (it
has, both actions has been marked as 'Success'), so it looks for next tasks
to run - it finds Task2
4. Action2 enters second transaction and checks if Task1 has ended (it
has, both actions has been marked as 'Success'), so it looks for next tasks
to run - it finds none, because of what happens in Action1 thread.
With this change, it is not only checked with DB if task has ended in
second transaction, but it also checks, if task was ended in the previous
transaction.
Closes-Bug: 1535722
Change-Id: Ifb2cfde4a88619 b7664669f2d5ca1 4fa47379961