Bug 1503037

Summary: [RFE] Cancelled future/recurring job invocations should not get the status "failed" but rather "cancelled"
Product: Red Hat Satellite Reporter: Ture Karlsson <tkarlsso>
Component: Remote ExecutionAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: low Docs Contact:
Priority: low    
Version: 6.2.12CC: aagrawal, aruzicka, bkearney, egolov, inecas, johan.bjornell, mhulan
Target Milestone: 6.8.0Keywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_remote_execution-3.2.0,tfm-rubygem-dynflow-1.0.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 12:57:21 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 Ture Karlsson 2017-10-17 09:04:10 UTC
Description of problem:

When scheduling a job for execution in the future, it gets the status "queued". If you go to the job and press "Cancel job", the job gets status "failed" the task will contain a huge error output. This is not a good user experience.  


Version-Release number of selected component (if applicable):
6.2.12


How reproducible:
Always

Steps to Reproduce:
1. Go to Hosts -> Job templates 
2. Choose a Job template, e.g. "Run Command - SSH Default", and click "Run" at the right hand side
3. Enter a Search query, e.g "name = test.example.com"
4. Enter a command to execute, e.g. "whoami" 
5. Click on "Schedule future execution" and enter a date in the future, e.g. an hour later
6. Click Submit
7. Go to Monitor -> Jobs
8. Notice that the new job has status "queued" 
9. Click on the job name, in this case "Run whoami"
10. Click on "Cancel Job"
11. Click on "Job Task" and notice that "State: stopped" and "Result: error" and the long error message
12. Go back to Monitor -> Jobs and notice that the job status is now "failed" 

Actual results:
Job status is "failed" with a huge error message in the task.

Expected results:
Job status should be "cancelled" and the error message should not clutter the job task. 

Additional info:
It would be a much better user experience if the there is another status called "cancelled". This would allow users to separate tasks that have actually failed because of something not working properly and jobs that are cancelled manually.

Comment 1 Adam Ruzicka 2017-10-17 12:07:43 UTC
Support for having cancelled remote execution jobs go into special "cancelled" state was added as a part of the attached BZ. What remains to be done is having this kind of behaviour for delayed/recurring jobs. Changing this BZ's title to reflect that.

Comment 2 Adam Ruzicka 2017-10-17 12:08:26 UTC
Created redmine issue http://projects.theforeman.org/issues/21358 from this bug

Comment 3 Satellite Program 2018-01-26 23:14:37 UTC
Upstream bug assigned to ddolguik

Comment 4 Satellite Program 2018-01-26 23:14:41 UTC
Upstream bug assigned to ddolguik

Comment 5 Anand Agrawal 2019-09-10 14:50:04 UTC
Hello Team,

I have a customer looking for the same feature.

Do we have any timeline or Satellite version to share, when this would be included?

Regards,
Anand

Comment 8 Peter Ondrejka 2020-05-21 13:50:22 UTC
Verified on Satellite 6.8 snap 1, the cancelled state is now assigned to cancelled jobs (one-time, delayed, recurring) and the state is communicated in jobs and rec. logics ui pages, in task details widget and is available in task search.

Comment 11 errata-xmlrpc 2020-10-27 12:57:21 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 (Important: Satellite 6.8 release), 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-2020:4366