Skip to content

fix: rollback pending state on tempfile failure in prepare_add#2689

Open
srpatcha wants to merge 1 commit intomozilla:mainfrom
srpatcha:fix/prepare-add-rollback
Open

fix: rollback pending state on tempfile failure in prepare_add#2689
srpatcha wants to merge 1 commit intomozilla:mainfrom
srpatcha:fix/prepare-add-rollback

Conversation

@srpatcha
Copy link
Copy Markdown

Summary

\prepare_add\ updated pending size before \ empfile_in(), which never rolled back on failure. This caused \make_space()\ to panic later when encountering negative available space.

Moved state update after successful tempfile creation and replaced .expect()\ with ?\ operator.

This is split from #2679 per reviewer feedback to keep changes focused.

Changes

  • \src/lru_disk_cache/mod.rs: Move pending size update after tempfile success
  • \src/server.rs: Replace .expect()\ with ?\ operator

Signed-off-by: Srikanth Patchava spatchava@meta.com

prepare_add updated pending size before tempfile_in(), which never
rolled back on failure. This caused make_space() to panic later when
encountering negative available space. Moved state update after
successful tempfile creation and replaced .expect() with ? operator.

Signed-off-by: Srikanth Patchava <spatchava@meta.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant