The semantical difference between "on-complete" and "on-success" + "on-error" is not documented

Bug #1642908 reported by Renat Akhmerov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
Renat Akhmerov

Bug Description

The following workflow fails even though 'task2' is success:
wf:
  tasks:
    task1:
      action: std.fail
      on-complete:
        - task2

    task2:
      action: std.noop

but if I use on-error and on-success clause to move control to 'task2' workflow goes to success state:

wf:
  tasks:
    task1:
      action: std.fail
      on-success:
        - task2
      on-error:
        - task2

    task2:
      action: std.noop

Even though these two examples look identical they are handled slightly differently in the code. If we explicitly have “on-error” it is treated as “catch” in normal programming languages and it prevents an error from bubbling up. “on-complete” is more like “finally” which doesn’t prevent an exception from bubbling up but rather allows to do some clean up actions.

So, this is expected behavior although it may be confusing.

This needs to be clearly documented.

Changed in mistral:
milestone: none → ocata-2
importance: Undecided → Medium
status: New → Confirmed
jzx (xuange)
Changed in mistral:
assignee: nobody → jzx (xuange)
jzx (xuange)
Changed in mistral:
assignee: jzx (xuange) → nobody
Changed in mistral:
milestone: ocata-2 → ocata-3
assignee: nobody → Renat Akhmerov (rakhmerov)
Changed in mistral:
milestone: ocata-3 → ocata-rc2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (master)

Fix proposed to branch: master
Review: https://review.openstack.org/433557

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

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

commit c82166329bba666dad3d466b9fadf26353f39bea
Author: Renat Akhmerov <email address hidden>
Date: Tue Feb 14 17:05:54 2017 +0700

    Add details into docs about semantics of 'on-XXX' clauses.

    Change-Id: I003b7940ed8e2eee9d7dbd61261a6585964df029
    Closes-Bug: #1642908

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

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/434840

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

Reviewed: https://review.openstack.org/434840
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=1e150100fdb9a08964e9fe14305ddf2ea89da2c4
Submitter: Jenkins
Branch: stable/ocata

commit 1e150100fdb9a08964e9fe14305ddf2ea89da2c4
Author: Renat Akhmerov <email address hidden>
Date: Tue Feb 14 17:05:54 2017 +0700

    Add details into docs about semantics of 'on-XXX' clauses.

    Change-Id: I003b7940ed8e2eee9d7dbd61261a6585964df029
    Closes-Bug: #1642908
    (cherry picked from commit c82166329bba666dad3d466b9fadf26353f39bea)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 4.0.0.0rc2

This issue was fixed in the openstack/mistral 4.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 5.0.0.0b1

This issue was fixed in the openstack/mistral 5.0.0.0b1 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.