generated from ipfs/ipfs-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 138
fix(mfs): limit cache growth by default #1037
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
Merged
Merged
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
adds auto-flush mechanism when directory cache exceeds 256 entries (matching HAMT shard size). this prevents unbounded memory growth when using --flush=false with many MFS operations. the cache limit is currently hardcoded but marked as TODO for future configurability. related to ipfs/kubo#10842
adds SetMaxCacheSize methods to Root and Directory to allow runtime configuration of the cache limit. subdirectories inherit the parent's cache size setting. this allows users to tune the cache size based on their needs: - smaller for memory-constrained environments - larger for heavy MFS usage - 0 to disable limiting (old behavior) related to ipfs/kubo#10842
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1037 +/- ##
==========================================
- Coverage 60.65% 60.64% -0.02%
==========================================
Files 268 268
Lines 33560 33599 +39
==========================================
+ Hits 20357 20375 +18
- Misses 11525 11540 +15
- Partials 1678 1684 +6
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
gammazero
approved these changes
Sep 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
lidel
added a commit
that referenced
this pull request
Sep 22, 2025
removes the cache auto-flush feature from #1037 that could cause data corruption with parallel MFS operations. letting applications implement their own safety mechanisms is safer than enforcing automatic flushing in the library. related to ipfs/kubo#10842
This was referenced Sep 22, 2025
lidel
added a commit
that referenced
this pull request
Sep 25, 2025
removes the cache auto-flush feature from #1037 that could cause data corruption with parallel MFS operations. letting applications implement their own safety mechanisms is safer than enforcing automatic flushing in the library. related to ipfs/kubo#10842
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.
ipfs files rmhanging kubo#10842