inaccurate task state on yaql error during task transition

Bug #1510738 reported by Winson Chan
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
High
Winson Chan

Bug Description

Given the following workflow with an async task1, if the task1 state is updated to SUCCESS thru the action execution API (since it's an async task), the YAQL error in task2 input will lead to the WF execution in ERROR and task1 in RUNNING.

wf:
  type: direct
  tasks:
    task1:
      action: std.async_noop
      on-complete
        - task2
    task2:
      action: std.echo output=<% wrong(yaql) %>

Given similar workflow but all tasks are sync, on task1 completion, the WF execution will be in ERROR and task1 will be in ERROR. Task1 has successfully completed and should be marked SUCCESS.

wf:
  type: direct
  tasks:
    task1:
      action: std.noop
      on-complete
        - task2
    task2:
      action: std.echo output=<% wrong(yaql) %>

Changed in mistral:
assignee: nobody → Winson Chan (winson-c-chan)
Changed in mistral:
milestone: none → mitaka-1
importance: Undecided → High
status: New → Triaged
Changed in mistral:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

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

commit 93b19335f5992f74ac0edcd4f95c0ad06d101b74
Author: Winson Chan <email address hidden>
Date: Wed Oct 28 02:18:22 2015 +0000

    Fix state change on exception during task state change

    If there is an exception during on_task_state_change, particularly if
    there is a YAQL evaluation error in the input of the next task, the state
    of the current task and related action execution will be marked ERROR for
    sync task and rolled back for async task, leaving the task as orphaned in
    RUNNING state in most cases. This is a workflow handling error and the
    workflow execution state is already marked ERROR. The state of the current
    task execution should not be affected.

    Change-Id: Id28b0661c09efa80a666d9eb7606fb435641a989
    Closes-Bug: #1510738

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/249592

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

Reviewed: https://review.openstack.org/249592
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=84c46be347863d285f17afb61fadea5b60bafa0d
Submitter: Jenkins
Branch: stable/liberty

commit 84c46be347863d285f17afb61fadea5b60bafa0d
Author: Winson Chan <email address hidden>
Date: Wed Oct 28 02:18:22 2015 +0000

    Fix state change on exception during task state change

    If there is an exception during on_task_state_change, particularly if
    there is a YAQL evaluation error in the input of the next task, the state
    of the current task and related action execution will be marked ERROR for
    sync task and rolled back for async task, leaving the task as orphaned in
    RUNNING state in most cases. This is a workflow handling error and the
    workflow execution state is already marked ERROR. The state of the current
    task execution should not be affected.

    Change-Id: Id28b0661c09efa80a666d9eb7606fb435641a989
    Closes-Bug: #1510738
    (cherry picked from commit 93b19335f5992f74ac0edcd4f95c0ad06d101b74)

tags: added: in-stable-liberty
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/mistral 2.0.0.0b1

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

Changed in mistral:
status: Fix Committed → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/mistral 1.0.1

This issue was fixed in the openstack/mistral 1.0.1 release.

Changed in mistral:
milestone: mitaka-1 → 2.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

This issue was fixed in the openstack/mistral 1.0.1 release.

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.