Mistral workflow including 'with-items' is not starting on-success task

Bug #1535722 reported by Dawid Deja
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Critical
Unassigned

Bug Description

How to reproduce:
1. Create workflow
$ cat simple-workflow.yaml
---
version: '2.0'

simple-workflow:
    description: foo
    type: direct
    output:
        out: <% $.out2 %>

    tasks:
        task1:
            with-items: x in ["1","2"]
            action: std.echo output=<% $.x %>
            publish:
                out1: <% $.task1 %>
            on-success:
                - task2

        task2:
            with-items: y in ["3","4"]
            action: std.echo output=<% $.y %>
            publish:
                out2: <% $.task2 %>

2. Run workflow and see it execution status
$ mistral execution-create simple-workflow
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| ID | c9fb2534-fb6a-4819-9be6-b0c4254aa56f |
| 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-fb6a-4819-9be6-b0c4254aa56f
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| ID | c9fb2534-fb6a-4819-9be6-b0c4254aa56f |
| 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-0b02-4b80-9055-ca56914fb2d4 | task1 | simple-workflow | c9fb2534-fb6a-4819-9be6-b0c4254aa56f | SUCCESS | None |
+--------------------------------------+-------+-----------------+--------------------------------------+---------+------------+
$ mistral execution-get-output c9fb2534-fb6a-4819-9be6-b0c4254aa56f
{
    "out": "<% $.out2 %>"
}

Expected result: All task from workflow are beeing run

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

Reviewed: https://review.openstack.org/273579
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=d9b2fb7cd34d6aa26a5c1d71cc80ec4a1ac2ffd3
Submitter: Jenkins
Branch: master

commit d9b2fb7cd34d6aa26a5c1d71cc80ec4a1ac2ffd3
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: Ifb2cfde4a88619b7664669f2d5ca14fa47379961

Changed in mistral:
status: New → Fix Released
Lingxian Kong (kong)
Changed in mistral:
milestone: none → mitaka-3
importance: Undecided → Critical
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/mistral 2.0.0.0b3

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

Changed in mistral:
milestone: mitaka-3 → 2.0.0
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.