Bug 2047787

Summary: Add real support for force cancelling tasks
Product: Red Hat Satellite Reporter: Adam Ruzicka <aruzicka>
Component: Tasks PluginAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED MIGRATED QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: aruzicka, ldelouw, pmoravec, rlavi, saydas
Target Milestone: UnspecifiedKeywords: MigratedToJIRA, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-06 02:21:40 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:
Embargoed:

Description Adam Ruzicka 2022-01-28 14:36:51 UTC
Description of problem:
Tasks/dynflow does not have real support for force cancelling.

The only thing we had was unlocking, which turned the task into stopped state without touching the execution plan iff the task was paused. We also had force unlocking, which did the same thing but it didn't care if the task was paused or not. The important thing is that after an unlock, resources locked by this task were free to be used again.

We also had cancellation, which required cooperation from the task itself and in general was rather asynchronous. It could take quite some time for the cancellation to propagate through the whole task. Another issue is there were tasks which weren't cancellable at all.

During a UI refresh we added a "force cancel" action to the ui, but it was just a rebrand of "force unlock". It unlocked the resources, turned the task over to stopped, but nothing told dynflow to actually stop doing things with the execution plan.

Tasks were always meant just as a frontend to dynflow, tasks are updated when things happen in dynflow. If we change the task directly, but dynflow keeps going, it may overwrite the changes we did to the task by hand.

Version-Release number of selected component (if applicable):
Satellite 6.9, 6.10, 7.0, possibly even older releases


How reproducible:
Sometimes

Steps to Reproduce:
1. Have a task which takes a long time, such as content sync
2. Let it run for a while
3. Force cancel it
4. Observe the task and its corresponding execution plan in dynflow console
5. Restart dynflow-sidekiq@* services

Actual results:
At 4 the task is stopped, the execution plan is still running.
At 5 there is a slight change the execution plan will still be running and the task as well.

Expected results:
At 4 both the task an execution plan are stopped. Steps of the execution plan might still be running, but that should be ok, the important thing is it won't progress anymore.
At 5, both are stopped, there should be no running steps.

Additional info:
We will need to add support for force cancellation to dynflow and then make tasks use it.

Comment 1 Adam Ruzicka 2022-01-28 14:41:03 UTC
Created redmine issue https://projects.theforeman.org/issues/34344 from this bug

Comment 13 Eric Helms 2024-06-06 02:21:40 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.