Bug 1384548 - [RFE] cronjob to clear old tasks
Summary: [RFE] cronjob to clear old tasks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.2.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: Unspecified
Assignee: Martin Bacovsky
QA Contact: Peter Ondrejka
URL:
Whiteboard:
: 1429660 (view as bug list)
Depends On:
Blocks: 1122832 1479962
TreeView+ depends on / blocked
 
Reported: 2016-10-13 14:08 UTC by Chris Duryee
Modified: 2019-12-16 07:05 UTC (History)
15 users (show)

Fixed In Version: foreman-tasks-0.9.6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 12:36:49 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 16922 0 High Closed cronjob to clear old tasks 2020-08-20 20:37:54 UTC
Github theforeman puppet-foreman pull 582 0 None closed Fixes #20819 - Allow turning task cleanup cron on and off 2020-08-20 20:37:54 UTC
Red Hat Bugzilla 1425471 0 medium CLOSED Satellite 6.1 does not clean finished tasks by default 2021-02-22 00:41:40 UTC
Red Hat Knowledge Base (Solution) 3374401 0 None None None 2018-03-07 13:12:44 UTC
Red Hat Product Errata RHSA-2018:0336 0 normal SHIPPED_LIVE Important: Satellite 6.3 security, bug fix, and enhancement update 2018-02-21 22:43:42 UTC

Internal Links: 1425471

Description Chris Duryee 2016-10-13 14:08:17 UTC
Description of problem:

Satellite 6.2 comes with foreman_tasks:cleanup, a job that will clear old tasks. This works well and helps significantly with issues like slow dashboard loading due to repo sync lookup times, but users need to remember to run the cleanup periodically.

Ideally, if the job was run via cron (similar to orphan task cleanup), users would not hit as many issues related to large numbers of old tasks.

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

Comment 2 Ivan Necas 2016-10-13 18:38:09 UTC
Created redmine issue http://projects.theforeman.org/issues/16922 from this bug

Comment 5 pm-sat@redhat.com 2017-03-15 10:10:03 UTC
Upstream bug assigned to mbacovsk@redhat.com

Comment 6 Lukas Zapletal 2017-07-20 13:15:37 UTC
Please make sure task also deletes all tasks even those which are in error state. I cannot get it working, this does not delete tasks in stopped-error state:

ALL_STATES="pending,scheduled,planning,planned,running,paused,stopped,cancelled"
/usr/sbin/foreman-rake foreman_tasks:cleanup TASK_SEARCH='label != a_label' AFTER='30d' STATES="$ALL_STATES

Comment 7 Eric Helms 2017-07-27 19:38:37 UTC
I think this can be a risky thing to do automatically without user opt-in as this does destroy data. Data a user could be using for auditing, tracking, trends. I've commented on the upstream PR [1] but wanted to include strong consideration for this before we go willy-nilly deleting users data out from under them.

https://github.com/theforeman/foreman-tasks/pull/247#issuecomment-318464803

Comment 8 Chris Duryee 2017-08-08 19:48:43 UTC
I updated the PR, not sure if here or there is a better place for convo but I don't want it in two places.

Comment 10 Adam Ruzicka 2017-08-22 10:19:55 UTC
*** Bug 1429660 has been marked as a duplicate of this bug. ***

Comment 11 pm-sat@redhat.com 2017-09-19 12:10:24 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16922 has been resolved.

Comment 12 Ivan Necas 2017-09-20 15:44:48 UTC
Moving to assigned, as the original issue was moved back to ready for testing

Comment 13 pm-sat@redhat.com 2017-09-21 10:10:20 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16922 has been resolved.

Comment 22 errata-xmlrpc 2018-02-21 12:36:49 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-2018:0336


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