-
Notifications
You must be signed in to change notification settings - Fork 180
Removing unused assets #5130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rakibhossainctr
wants to merge
11
commits into
develop/6
Choose a base branch
from
asset-lifecycle-sync
base: develop/6
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Removing unused assets #5130
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… management - Add LastAccessed field to RuntimeAsset struct to track asset usage - Update boltDBAssetManager.Get() to record timestamps on asset access - Add updateLastAccessed() helper method for atomic timestamp updates - Update asset creation to set initial LastAccessed timestamp - Update all test files to include LastAccessed field in struct initialization - Fix TestGetAllError to expect empty slice instead of nil for Go consistency - Add comprehensive test coverage for timestamp functionality This change enables tracking of asset usage patterns as the foundation for implementing asset cleanup functionality based on last access time. The implementation maintains backward compatibility and follows existing BoltDB transaction patterns for data consistency. Signed-off-by: rakibhossainctr <[email protected]>
Signed-off-by: rakibhossainctr <[email protected]>
Signed-off-by: rakibhossainctr <[email protected]>
- exposed new method to delete and find unused assets Signed-off-by: rakibhossainctr <[email protected]>
cc39649 to
1f091e7
Compare
- restructure agent db and cache dir creation - created a method to fetch db connection from enterprise edition - restructure start asset manager process Signed-off-by: rakibhossainctr <[email protected]>
Signed-off-by: rakibhossainctr <[email protected]>
… execution Signed-off-by: rakibhossainctr <[email protected]>
Signed-off-by: rakibhossainctr <[email protected]>
- fixed: AfterAgentRun and BeforeAgentRun, now able to send all errors incase of fatal plugin - removed local references in go.mod file Signed-off-by: rakibhossainctr <[email protected]>
Signed-off-by: rakibhossainctr <[email protected]>
Signed-off-by: rakibhossainctr <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this change?
This change introduces automatic cleanup of unused agent runtime assets by purging assets that have not been accessed within a configurable time window, along with improved event handling for failed asset downloads.
Why is this change necessary?
Several customers (including TD Bank, Ingenico, and others) have requested a scalable mechanism for cleaning up unused assets. Current workarounds — such as manually deleting the
--cache-dir— are not viable and often lead to operational issues, including:exit status 127(“command not found”)This change reduces unnecessary cache growth, prevents redundant asset downloads, and improves the reliability of event reporting related to asset failures.
Does your change need a Changelog entry?
Yes — this change adds new functionality to the sensu-agent and modifies its runtime behavior.
Do you need clarification on anything?
N/A at this time.
Were there any complications while making this change?
Have you reviewed and updated the documentation for this change? Is new documentation required?
Yes
How did you verify this change?
exit status 127when the failure is due to an asset download timeoutIs this change a patch?
No