Bug 2103022

Summary: [RFE] Improve archive clean up mechanism
Product: Red Hat Enterprise Linux 8 Reporter: Jan Senkyrik <jsenkyri>
Component: insights-clientAssignee: CSI Client Tools Bugs <csi-client-tools-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.6CC: ahitacat, cmarinea, fjansen, gchamoul, pakotvan, rfurlan, stomsa
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-25 08:55:48 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 Jan Senkyrik 2022-07-01 08:29:47 UTC
Description of problem:

Bug 2009773 had introduced a new clean up mechanism for leftover insights archives in /var/tmp directory:

~~~
Handle SIGTERM signal

Archive is created in a directory under /var/tmp with the same prefix "insights-archive-". 
Each time a new archive is created, it removes the previous one if it exists. 
Reducing the amount of directories created and stored at the same time.
~~~


It's great that we implemented this but it's not ideal. The leftover archives will be there until the next insights run (usually 24hrs). It would be better to handle the clean-up during or right after insights run fails (for whatever reason).

Comment 3 Alba Hita 2022-07-04 15:44:27 UTC
Hi Jan (@jsenkyri)
The archive will only remain in /tmp/insights-archive when insights-client is killed with a SIGKILL signal. 
Keeping the file due to a failure could help investigate the cause of the problem. 
If we remove the archive right before the insights-client is killed, there is no 
room for post-mortem analysis in the archive.

Comment 4 Jan Senkyrik 2022-07-05 07:22:58 UTC
Hi Alba,

Right, that makes perfect sense.

Thanks for the explanation.

Comment 6 Jan Senkyrik 2022-07-05 11:15:14 UTC
Customer agrees to close this RFE.