Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed windows compatibility issue, when storage gateway syncs index f… #7148

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

henrikschristensen
Copy link

…iles to local disk.

@henrikschristensen
Copy link
Author

fixes #7147

@@ -154,6 +155,8 @@ func WriteBinary(ctx context.Context, bkt objstore.BucketReader, id ulid.ULID, f
}

if tmpFilename != "" {
// On windows renaming an open file will result in access denied error
bw.writer.Close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this will cause issues with the deferred close above

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont see a way to check if a filedescriptor has already been closed. Maybe the Close function could set the file descriptor to nil after a succesful close. The Close function should then start by checking for nil and exit if true.

…iles to local disk.

Signed-off-by: henrikschristensen <51989221+henrikschristensen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants