Bug 2256071

Summary: Cancelling a job does not properly increment cancelled_count in its task
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: Tasks PluginAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED MIGRATED QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.14.0CC: aruzicka, pmendezh, rlavi
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 16:39:59 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 Pavel Moravec 2023-12-28 08:30:20 UTC
Description of problem:
Having a job execution that user cancels in the middle, then:
- job execution details does show proper number of successfull/failed/.. and cancelled counts, but
- task details of the RunHostsJob task does count the tasks that were running but cancelled as failed

That is incoherent and quite confusing esp. when support engineers get (html) task export and try to deduce the job output stats.


Version-Release number of selected component (if applicable):
any (6.11 till 6.15 snap 3)


How reproducible:
100%


Steps to Reproduce:
1. hammer job-invocation create --search-query "id ^ (3)" --job-template "Run Command - Script Default" --inputs "command='sleep 60'" --async
2. hammer job-invocation cancel --id 10  # the ID from previous output
3. Optionally, run a job with concurrency 2 against 4 Hosts and cancel it during the first "batch".
4. Check dynflow console of the RunHostsJob task (in WebUI or in html task export) and compare it with job invocation statistics


Actual results:
- Task from 1. has task with "failed_count: 1" but "cancelled_count: 0".
- Task from 3. has "failed_count: 2" and "cancelled_count: 2".


Expected results:
- Task from 1. should have "failed_count: 0" and "cancelled_count: 1".
- Task from 3. should have "failed_count: 0" and "cancelled_count: 4".


Additional info:

Comment 1 Eric Helms 2024-06-06 16:39:59 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.