mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
fix: remove auto-close GetObjectReader (#12009)
locks can get relinquished when Read() sees io.EOF leading to prematurely closing of the readers concurrent writes on the same object can have undesired consequences here when these locks are relinquished.
This commit is contained in:
@@ -817,13 +817,7 @@ func (g *GetObjectReader) Close() error {
|
||||
|
||||
// Read - to implement Reader interface.
|
||||
func (g *GetObjectReader) Read(p []byte) (n int, err error) {
|
||||
n, err = g.pReader.Read(p)
|
||||
if err != nil {
|
||||
// Calling code may not Close() in case of error, so
|
||||
// we ensure it.
|
||||
g.Close()
|
||||
}
|
||||
return
|
||||
return g.pReader.Read(p)
|
||||
}
|
||||
|
||||
//SealMD5CurrFn seals md5sum with object encryption key and returns sealed
|
||||
|
||||
Reference in New Issue
Block a user