Skip to content

blob/fileblob: clean up temp file on BeforeWrite error#3733

Merged
vangent merged 1 commit into
google:masterfrom
fallintoplace:fix-fileblob-beforewrite-cleanup
Jun 20, 2026
Merged

blob/fileblob: clean up temp file on BeforeWrite error#3733
vangent merged 1 commit into
google:masterfrom
fallintoplace:fix-fileblob-beforewrite-cleanup

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Fixes a leak in fileblob's NewTypedWriter when BeforeWrite returns an error. The temp file is created before BeforeWrite runs, so an early callback error left the file open and on disk.

This closes and removes the temp file before returning the callback error, and adds a regression test that captures the temp filename through BeforeWrite and verifies it has been removed.

Tested:

  • go test ./blob/fileblob
  • go test ./blob/...

@vangent vangent merged commit 42c12ae into google:master Jun 20, 2026
9 checks passed
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.

2 participants