Due to a recent update on Javascript code a full page refresh on your browser might be needed.

Bug 1441353

Summary: Automate State machine not honoring MIQ_STOP properly
Product: Red Hat CloudForms Management Engine Reporter: Tina Fitzgerald <tfitzger>
Component: AutomateAssignee: Tina Fitzgerald <tfitzger>
Status: CLOSED ERRATA QA Contact: Ganesh Hubale <ghubale>
Severity: medium Docs Contact:
Priority: high    
Version: 5.7.0CC: ghubale, jhardy, mkanoor, obarenbo, simaishi, tfitzger, wfitzger
Target Milestone: GA   
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.0.14 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-07 23:02:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Tina Fitzgerald 2017-04-11 18:39:53 UTC
Description of problem:
Tested the MIQ_STOP and MIQ_ABORT method return code for both relationships and state machines.  

The relationship tests worked as expected: 

MIQ_STOP
class A instance  
relationship rel1  
   calls --> class B instance(instance calls a method that sets MIQ_STOP)
relationship rel2 - proceeds normally because stop only stopped class B instance

MIQ_ABORT
class A instance  
relationship rel1  
   calls --> class B instance(instance calls a method that sets MIQ_ABORT)
relationship rel2 - does not get called because entire resolution aborted

--------------------------------------------------------------------------

The state machine tests did not work as expected: 
MIQ_STOP
state machine class A instance  
state relationship state1  
   calls --> state machine class B instance(instance calls a method that sets MIQ_STOP)
state relationship state2 - does not get called because entire resolution aborted

MIQ_ABORT 
state machine class A instance  
state relationship state1  
   calls --> state machine class B instance(instance calls a method that sets MIQ_ABORT)
state relationship state2 - does not get called because entire resolution aborted


Actual results:
The state machine aborted when MIQ_STOP was set

Expected results:
The calling state machine should have continued after the MIQ_STOP

Comment 2 Tina Fitzgerald 2018-08-27 16:24:47 UTC
Madhu created the following PR for this issue:
https://github.com/ManageIQ/manageiq-automation_engine/pull/208

Comment 3 William Fitzgerald 2018-09-20 21:09:11 UTC
Results are different based on how the method is called.

I tested State MachineA calling State MachineB.  In one of the State MachineB steps,
a method with "exit MIQ_STOP" is called.

I am getting different results based on how the method is called. 
 
1. If you use an instance that connects to the method like : /Service/Provisioning/StateMachines/Methods/miq_stop

It will continue to the next step in State MachineB. Not expected

2. If you use METHOD::miq_stop syntax,

It will stop and return to State MachineA.  It will NOT run any more steps in State MachineB and return to the next step in State MachineA.   This is expected.

Billy

Comment 6 errata-xmlrpc 2019-02-07 23:02:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:0212