Sasha
Services
Debug Plane Housekeeping Server
Overview
- This is a maintenance service that automatically manages files and directories on the debug plane using a configured retention period.
- This is required to control the disc space used by post-mortem and other files on the debug plane.
- This service is designed to execute on a schedule; a single log entry for a summary of any deleted (or failed to be deleted) files or deleted directories will be generated.
Installation and Configuration
- The service is installed and active by default.
- It is configuration-driven with fallback to defaults in the configuration yaml files.
For example
values.yaml
:attribute description default required disabled Disable or enable this service. false optional interval Minimum interval between debug plane housekeeping expiry checking (in hours, 0 disables). 24 optional at Schedule to check for debug plane expired files and directories (cron format). * 3 * * * optional expiryDays Default number of days passed that debug plane files or directories are deleted. 14 optional
User Guide
How it works in steps
- The
disabled
value is read from the component configuration - If
disabled
istrue
then the service is not started. - The schedule is read from the component configuration.
- If the
interval
is 0 then the service is stopped. - The debug plane location is read from the component configuration.
- The service
Thread
is started. - A loop of the following is started until the service is stopped:
- A one minute wait is imposed.
- If the schedule using
at
andinterval
indicates that the housekeeping is required then:- Any exceptions from the following are caught and logged.
- The debug plane directory list is read.
- The list of files and directories in the debug plane are processed:
- If the file or directory's modified date is over
expiryDays
old then:- The file or directory is deleted.
- A counter for each file or directory is maintained.
- If the file or directory's modified date is over
- A log entry is made giving the total number of files and directories deleted.
- Any exceptions from the following are caught and logged.
Inputs and Outputs
- The component configuration as per Installation and Configuration is the input for this service.
- The outputs are any logs generated for errors and deletion statistics.
Error Handling
- Known exceptions are handled to prevent service interruption.
Limitations and Considerations
- The service ensures it only runs in containerized environments.
Future Possible Enhancements
- A bare metal implementation.
- Logging freed up disc space statistics.