Bug 1441353 - Automate State machine not honoring MIQ_STOP properly
Summary: Automate State machine not honoring MIQ_STOP properly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.10.0
Assignee: Tina Fitzgerald
QA Contact: Ganesh Hubale
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-11 18:39 UTC by Tina Fitzgerald
Modified: 2019-02-07 23:02 UTC (History)
7 users (show)

Fixed In Version: 5.10.0.14
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-07 23:02:25 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:0212 0 None None None 2019-02-07 23:02:31 UTC

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


Note You need to log in before you can comment on or make changes to this bug.