Skip to content

fix: close temp file before rename in sidecar StoreAttribute#2046

Merged
benmcclelland merged 1 commit intomainfrom
ben/windows-sidecar
Apr 15, 2026
Merged

fix: close temp file before rename in sidecar StoreAttribute#2046
benmcclelland merged 1 commit intomainfrom
ben/windows-sidecar

Conversation

@benmcclelland
Copy link
Copy Markdown
Member

On Windows, a file apparently cannot be renamed while an open handle to it exists.
The previous code used defer tempfile.Close(), which meant the handle was still open when os.Rename was called, producing:

failed to rename temporary file: The process cannot access
the file because it is being used by another process.

Fix by closing the file explicitly before the rename.

Fixes #2021

On Windows, a file apparently cannot be renamed while an open
handle to it exists.
The previous code used defer tempfile.Close(), which meant the
handle was still open when os.Rename was called, producing:

  failed to rename temporary file: The process cannot access
  the file because it is being used by another process.

Fix by closing the file explicitly before the rename.

Fixes #2021
@benmcclelland benmcclelland requested a review from niksis02 April 15, 2026 15:14
@benmcclelland benmcclelland merged commit e8680bd into main Apr 15, 2026
122 checks passed
@benmcclelland benmcclelland deleted the ben/windows-sidecar branch April 15, 2026 19:33
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.

[Bug] - Creating buckets with 1.4.0 fails on Windows

2 participants