Fix memory leak issue by implementing an LRU cache for AWS credentials.#1825
Open
dlorenc wants to merge 1 commit intosigstore:mainfrom
Open
Fix memory leak issue by implementing an LRU cache for AWS credentials.#1825dlorenc wants to merge 1 commit intosigstore:mainfrom
dlorenc wants to merge 1 commit intosigstore:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1825 +/- ##
===========================================
- Coverage 42.78% 31.17% -11.61%
===========================================
Files 121 123 +2
Lines 8994 9151 +157
===========================================
- Hits 3848 2853 -995
- Misses 4791 6065 +1274
+ Partials 355 233 -122 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
959c391 to
c02ff67
Compare
hectorj2f
previously approved these changes
Apr 21, 2025
Member
|
@dlorenc one lint error otherwise lgtm |
23bf9c0 to
9518491
Compare
f059b50 to
9cf55f9
Compare
732b765 to
4d1b718
Compare
This change prevents unbounded memory growth in long-running processes by implementing a bounded LRU cache for ECR credentials with the following features: - Bounded cache size (default: 100 entries) to prevent memory leaks - TTL-based expiration (default: 6 hours) to ensure credential freshness - Thread-safe operations for concurrent access - Graceful fallback to unbounded cache if bounded cache creation fails - Comprehensive test coverage including unit and integration tests The implementation uses hashicorp/golang-lru/v2 for the LRU cache and wraps the existing ECR credential helper to maintain compatibility while adding memory safety. Signed-off-by: Dan Lorenc <dlorenc@chainguard.dev>
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
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.
Summary
Try to fix #1820
Release Note
Documentation