Comment 1 for bug 1424461

Revision history for this message
Winson Chan (winson-c-chan) wrote :

Please note the WF is slightly different. This is another bug. There's a race condition on publishing vars. Whereas the one above failed to execute the join task.

EXPECTED:
{
    "is_done": true,
    "var1": true,
    "var2": true
}

ACTUAL:
{
    "is_done": true,
    "var1": false,
    "var2": true
}

~/st2$ cat ~/tmp/test-complex-join.yaml
version: '2.0'
name: test-complex-join

workflows:

    main:
        type: direct
        output:
            var1: <% $.var1 %>
            var2: <% $.var2 %>
            is_done: <% $.is_done %>
        tasks:
            init:
                publish:
                    var1: false
                    var2: false
                    is_done: false
                policies:
                    wait-after: 1
                on-success:
                    - branch1
                    - branch2
            branch1:
                workflow: work
                publish:
                    var1: true
                policies:
                    retry:
                        count: 10
                        delay: 2
                on-success:
                    - done
            branch2:
                publish:
                    var2: true
                on-success:
                    - done
            done:
                join: all
                publish:
                    is_done: true

    work:
        type: direct
        tasks:
            do:
                action: std.echo output="Doing..."
                on-success:
                    - exit
            exit:
                action: std.echo output="Exiting..."

~$ mistral workbook-create ~/tmp/test-complex-join.yaml
Starting new HTTP connection (1): localhost
+------------+----------------------------+
| Field | Value |
+------------+----------------------------+
| Name | test-complex-join |
| Tags | <none> |
| Created at | 2015-02-22 23:15:42.201216 |
| Updated at | None |
+------------+----------------------------+

~$ mistral execution-create test-complex-join.main
Starting new HTTP connection (1): localhost
+------------+--------------------------------------+
| Field | Value |
+------------+--------------------------------------+
| ID | 95b37c87-02c3-4991-903e-0a2619419a2d |
| Workflow | test-complex-join.main |
| State | RUNNING |
| Created at | 2015-02-22T23:15:52.054730 |
| Updated at | 2015-02-22T23:15:52.081809 |
+------------+--------------------------------------+

~$ mistral execution-list
Starting new HTTP connection (1): localhost
+--------------------------------------+------------------------+---------+---------------------+---------------------+
| ID | Workflow | State | Created at | Updated at |
+--------------------------------------+------------------------+---------+---------------------+---------------------+
| 95b37c87-02c3-4991-903e-0a2619419a2d | test-complex-join.main | SUCCESS | 2015-02-22 23:15:52 | 2015-02-22 23:15:54 |
| 1f1951df-4cc6-4b7f-b93f-f0ab4288d589 | test-complex-join.work | SUCCESS | 2015-02-22 23:15:53 | 2015-02-22 23:15:54 |
+--------------------------------------+------------------------+---------+---------------------+---------------------+

~$ mistral task-list
Starting new HTTP connection (1): localhost
+--------------------------------------+---------+------------------------+--------------------------------------+---------+
| ID | Name | Workflow name | Execution ID | State |
+--------------------------------------+---------+------------------------+--------------------------------------+---------+
| 6842c2ed-0b25-4c73-a75b-2a8c06da7cca | init | test-complex-join.main | 95b37c87-02c3-4991-903e-0a2619419a2d | SUCCESS |
| 0f0b1f00-4887-4834-a3be-4b64fa95ee9a | branch1 | test-complex-join.main | 95b37c87-02c3-4991-903e-0a2619419a2d | SUCCESS |
| 15efe17f-6d44-406f-ae05-87970b5ca274 | do | test-complex-join.work | 1f1951df-4cc6-4b7f-b93f-f0ab4288d589 | SUCCESS |
| 35a90db5-4543-43d5-80f4-398db522f8b1 | branch2 | test-complex-join.main | 95b37c87-02c3-4991-903e-0a2619419a2d | SUCCESS |
| aaeabc83-1b68-40fc-92fc-62822e80fae3 | done | test-complex-join.main | 95b37c87-02c3-4991-903e-0a2619419a2d | SUCCESS |
| b35f81a0-8b55-4a10-9bf2-c0e9d8cc8b1b | exit | test-complex-join.work | 1f1951df-4cc6-4b7f-b93f-f0ab4288d589 | SUCCESS |
+--------------------------------------+---------+------------------------+--------------------------------------+---------+

~$ mistral execution-get-output 95b37c87-02c3-4991-903e-0a2619419a2d
Starting new HTTP connection (1): localhost
{
    "is_done": true,
    "var1": false,
    "var2": true
}