media store: a failed write leaks its budget reservation #173

Merged
kami merged 1 commits from task/584-media-store-a-failed-write-leaks-its-bud into master 2026-08-06 09:41:32 +02:00
Contributor

Closes Vikunja #584.

Acceptance criteria and quality gate are in TASK.md on this branch.
Review the review, not the diff — leave comments and the agent will apply them via task start 584.

Closes Vikunja #584. Acceptance criteria and quality gate are in `TASK.md` on this branch. Review the review, not the diff — leave comments and the agent will apply them via `task start 584`.
claude added 1 commit 2026-08-06 09:39:06 +02:00
Put and PutFile added the blob size to s.total before writing, and only the
writeFile and os.Rename failure paths released it. A writeMeta failure in
either, and a chmod failure on the spool in PutFile, kept the size, so a store
that hit a full disk over-counted itself and could answer ErrStoreFull while
the disk had room until the next Open re-measured.

One defer per function now owns the release, disarmed on the success return,
so a future early return cannot reintroduce the leak.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
kami merged commit c7d22858ba into master 2026-08-06 09:41:32 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kami/Maven#173