kubo/test/dependencies
Marcin Rataj 904736c20e fix(mfs): add soft limit for --flush=false (#10985)
* fix: add MFS operation limit for --flush=false

adds a global counter that tracks consecutive MFS operations performed
with --flush=false and fails with clear error after limit is reached.

this prevents unbounded memory growth while avoiding the data corruption
risks of auto-flushing.

- adds Internal.MFSNoFlushLimit config
- operations fail with actionable error at limit
- counter resets on successful flush or any --flush=true operation
- operations with --flush=true reset and don't count

this commit removes automatic flush from https://github.com/ipfs/kubo/pull/10971
and instead errors to encourage users of --flush=false to develop a habit
of calling 'ipfs files flush' periodically.

boxo will no longer auto-flush (https://github.com/ipfs/boxo/pull/1041) to
avoid corruption issues, and kubo applies the limit to 'ipfs files' commands
instead.

closes #10842

* test: add tests for MFSNoFlushLimit

tests verify the new Internal.MFSNoFlushLimit config option:
- default limit of 256 operations
- custom limit configuration
- counter reset on flush=true
- counter reset on explicit flush command
- limit=0 disables the feature
- multiple MFS command types count towards limit

* docs: explain why MFS operations fail instead of auto-flushing

addresses feedback from https://github.com/ipfs/kubo/pull/10985#pullrequestreview-3256250970

- clarify that automatic flushing at limit was considered but rejected
- explain the data corruption risks of auto-flushing
- guide users who want auto-flush to use --flush=true (default)
- document benefits of explicit failure for batch operations

(cherry picked from commit a688b7eeac)
2025-09-27 03:21:55 +02:00
..
go-sleep vendor binary deps in test/dependencies 2015-09-10 18:09:12 -07:00
go-timeout fix govet warnings 2018-03-22 17:31:22 +01:00
iptb style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
ma-pipe-unidir style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
pollEndpoint chore: update test dependencies (#10555) 2024-10-21 17:07:53 -07:00
dependencies.go refactor(ci): optimize build workflows (#10973) 2025-09-19 14:44:38 +02:00
GNUmakefile fix: require gmake 2019-08-01 12:18:56 -07:00
go.mod fix(mfs): add soft limit for --flush=false (#10985) 2025-09-27 03:21:55 +02:00
go.sum fix(mfs): add soft limit for --flush=false (#10985) 2025-09-27 03:21:55 +02:00