Description of problem:
During migration cancellation tests, it has been observed that the change to the task options hash could be overridden, hence not taking into account the cancellation request.
The UI calls the API to add a key/value pair in the options hash to request cancellation. Because the options hash is cached, the automation code works on a copy of the hash that may not contains that key/value pair and when calling set_option to update the options hash, it will override with its own copy.
Version-Release number of selected component (if applicable): 184.108.40.206
How reproducible: Random
Steps to Reproduce:
1. Start a migration
2. Request cancellation from the UI
3. Check the task object
Actual results: Sometimes, the cancel_requested key is present, sometimes it's not.
Expected results: Changes to an option should not be subject to race condition.
The solution is to move the flag out of options into its own column. Reassign to Hui who provides the development work.
For 5.9.z release we will be going with the fix from https://github.com/ManageIQ/manageiq-automation_engine/pull/211 to resolve this issue.
The PRs mentioned in comment 4 and 5 will be moved to upstream fixes only.
Moving the issue to Bill and will adjust PR labels.
New commit detected on ManageIQ/manageiq-automation_engine/master:
Author: Bill Wei <firstname.lastname@example.org>
AuthorDate: Fri Aug 10 16:53:22 2018 -0400
Commit: Bill Wei <email@example.com>
CommitDate: Fri Aug 10 16:53:22 2018 -0400
lock model object when #set_option
As a temporary solution. It has a performance penalty. Ideally only one thread should update the options field.
lib/miq_automation_engine/service_models/mixins/miq_ae_service_miq_request_mixin.rb | 6 +-
spec/service_models/miq_ae_service_miq_request_spec.rb | 16 +-
2 files changed, 10 insertions(+), 12 deletions(-)
Simple Browser Refresh operation after cancel migration, wipes out the fact that we requested cancel migration.
New commit detected on ManageIQ/manageiq-v2v/hammer:
Author: Michael Ro <firstname.lastname@example.org>
AuthorDate: Thu Oct 18 08:19:05 2018 -0400
Commit: Michael Ro <email@example.com>
CommitDate: Thu Oct 18 08:19:05 2018 -0400
Merge pull request #708 from AparnaKarve/fix_cancel_issues
 Fix cancellation issues based on new backend changes
(cherry picked from commit c45b98b81cbf38a5cc2d0f43b0fd2dc13ce0e4e7)
2 files changed, 23 insertions(+), 10 deletions(-)
Last PR merged. Moving to POST.
Should be good in next 5.10 build.
*** Bug 1630013 has been marked as a duplicate of this bug. ***
New commit detected on ManageIQ/manageiq-content/hammer:
Author: Greg McCullough <firstname.lastname@example.org>
AuthorDate: Tue Nov 6 09:39:33 2018 -0500
Commit: Greg McCullough <email@example.com>
CommitDate: Tue Nov 6 09:39:33 2018 -0500
Merge pull request #457 from fdupont-redhat/v2v_use_cancelation_status
Use task cancelation_status to trigger cancelation
(cherry picked from commit 2160a0e410fa196b6a0061a62aa36e2705586c8e)
content/automate/ManageIQ/System/CommonMethods/MiqAe.class/__methods__/weightedupdatestatus.rb | 2 +-
content/automate/ManageIQ/Transformation/Common.class/__methods__/assesstransformation.rb | 2 +-
spec/content/automate/ManageIQ/Transformation/Common.class/__methods__/assesstransformation_spec.rb | 9 +-
3 files changed, 4 insertions(+), 9 deletions(-)
On 220.127.116.11 I was able to cancel in progress migrations.