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 #152 bug where s3 backend failed to read empty files #153

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

funkyshu
Copy link
Member

S3 backend errors when reading an empty file #152

@c2fo-cibot c2fo-cibot bot added the size/M Denotes a PR that changes 30-99 lines label Jan 22, 2024
@@ -535,26 +536,35 @@ func waitUntilFileExists(file vfs.File, retries int) error {

func (f *File) getReader() (io.ReadCloser, error) {
if f.reader == nil {
Copy link
Member Author

@funkyshu funkyshu Jan 22, 2024

Choose a reason for hiding this comment

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

GH does a poor job of showing that I just moved this down to be nested under 'else'. Basically, were checking the source size and return a noop readcloser if it's zero. Otherwize return the usual range-based s3 reader.

@funkyshu funkyshu requested a review from dhondgepooja January 22, 2024 19:04
@funkyshu funkyshu merged commit 0b59a4f into master Jan 22, 2024
8 checks passed
@funkyshu funkyshu deleted the empty_file_s3_bug_152 branch March 8, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants