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

Specify the behavior for writing empty file #678

Closed
Xuanwo opened this issue Jul 16, 2021 · 2 comments
Closed

Specify the behavior for writing empty file #678

Xuanwo opened this issue Jul 16, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Xuanwo
Copy link
Contributor

Xuanwo commented Jul 16, 2021

Code like the following could hang forever (tested on go-service-s3)

_, err = fs.s.Write(path,nil, 0)
if err != nil {
    fs.logger.Error("write", zap.String("path", path), zap.Error(err))
    return nil, nil, err
}

I have to write it like:

_, err = fs.s.Write(path, bytes.NewReader([]byte{}), 0)
if err != nil {
    fs.logger.Error("write", zap.String("path", path), zap.Error(err))
    return nil, nil, err
}

Maybe we can support user input nil Reader for empty files?

In order to add this support, we need to:

  • Add a new GSP to make it clear
  • Update definitions to reflect changes
  • Update integrations tests to make sure all service passed
@Xuanwo Xuanwo added the enhancement New feature or request label Jul 16, 2021
@Xuanwo Xuanwo changed the title Specific the behavior for writing empty file Specify the behavior for writing empty file Jul 16, 2021
@Xuanwo
Copy link
Contributor Author

Xuanwo commented Jul 16, 2021

ping @beyondstorage/go-storage-committer @beyondstorage/go-storage-maintainer for a look

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Sep 1, 2021

Moved to https://forum.beyondstorage.io/t/specify-the-behavior-for-writing-empty-file/204

BeyondStorage
Code like the following could hang forever (tested on go-service-s3) _, err = fs.s.Write(path,nil, 0) if err != nil { fs.logger.Error("write", zap.String("path", path), zap.Error(err)) return nil, nil, err } I have to write it like: _, err = fs.s.Write(path, bytes.NewReader([]byte{}), 0) if err != nil { fs.logger.Error("write", zap.String("path", path), zap.Error(err)) return nil, nil, err } Maybe we can support user input nil Reader for empty files? In order to add this sup...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant