Ownership of the buffer transfers to SaveBlobAsync. Callers can now take
a buffer from the buffer pool.
Internally saveAndEncrypt now reuses pooled buffers.
Current benchmarks all work with a single archiver, and are not suitable
for testing changes which might affect contention.
Add a benchmark with multiple small files and multiple concurrent
archivers.
The macOS failure in #22146 reaches the two-second readiness deadline. Give the test server ten seconds to start while retaining immediate readiness and context cancellation handling.
Unit tests fail on ppc64le due to a bug in golang.org/x/sys
Upstream fix[^1] is included in the v0.50.0 release.
Came across packaging for Alpine, which defaults to building PIE
binaries, when ppc64le build was segfaulting[^2] in the unit tests.
e.g.
```
--- FAIL: TestBackup (0.01s)
testing.go:30: using low-security KDF parameters for test
config.go:59: disabling check of the chunker polynomial
testing.go:30: using low-security KDF parameters for test
config.go:59: disabling check of the chunker polynomial
lock_file.go:93: setting lock timeout to 0s
panic: runtime error: invalid memory address or nil pointer dereference [recovered, repanicked]
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10a1daf38]
```
[^1]: https://github.com/golang/go/issues/82324
[^2]: https://gitlab.alpinelinux.org/bdd/aports/-/jobs/2617025
In UpgradeRepo, if upgradeRepository fails, the error handler attempts
contingency rollback by re-uploading the original config file.
However, the contingency path unconditionally executed repo.be.Remove(ctx, h)
before calling repo.be.Save. On backends supporting atomic replacement (such
as local filesystems), a failed upgrade (e.g. out-of-disk-space or permissions
error while writing the temporary file) leaves the original, valid version 1
configuration file completely intact on disk.
Unconditionally removing the config file during rollback actively deletes
the working configuration. If the subsequent Save call also fails, the
repository is left permanently corrupted without a config file.
Condition the pre-removal on !repo.be.Properties().HasAtomicReplace, matching
the forward upgrade path in upgradeRepository. Add a unit test asserting that
aborted upgrades on atomic backends preserve the intact original configuration.
---------
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
When loading or iterating a directory tree failed, traverseTreeInner
returned a nil file list together with the error. If the error handler
ignored the error, the caller still called leaveDir with that nil list,
and restore --delete removed every existing entry of the directory in
the target, even though the expected content was simply unknown.
Force disable deletion in that case, the same way it is already done
for invalid node names.
Signed-off-by: Dean Chen <862469039@qq.com>
* Small typos and clarification in contributing guide
* cross-link contributing guide and issue/pr template
* drop GOPATH mention
* don't include merge commits in PRs
* make high review delays explicit
* explicitly ask for link to current PR in changelog template
* clarify docs changes
* use bug template as authoritative place'
* consolidate development information in 090_participating
Also move issue / PR creation relevant information into contributing.md.
* clarify meaning of assigning to a pull request
* link to minimum go version
* minor typos
* golanci-lint is always applied in full
* add micro summary
* more typo fixes
* always run golangci-lint
* Simplify issue/pr template
* Fix IRC webchat link
* Move security policy to SECURITY.md
* address review comments
The file, blob and size counters were reset for every snapshot, so the
progress line only reflected the last processed snapshot.
Co-authored-by: Winfried Plappert <18740761+wplapper@users.noreply.github.com>
Motivation: when listing pack files fails during prune (for example due
to a request timeout), the error was returned unwrapped and main printed
it with "%+v", which dumps a stack trace. As discussed in the issue, the
error needs one more level of wrapping before it can be treated as a
fatal error.
Approach: in decidePackAction, wrap an error from listing pack files
with errors.Fatalf("failed to list pack files: %v"). Errors that are
already fatal (e.g. ErrSizeNotMatching) and errors after context
cancellation are returned unchanged. The underlying error is preserved
via Unwrap. Retry log messages are unchanged; only the final error
output is shortened and says where the failure occurred.
Validation: `go test ./internal/repository/ -run Prune` and
`go test ./cmd/restic/ -run Prune` pass. The new test
TestPrunePackListError (backend whose pack list fails) fails without
the change and passes with it. I did not reproduce a real REST backend
timeout.
Report: https://github.com/restic/restic/issues/22120
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Assisted-by: claude-sonnet-5-5 (via Claude Code)