Fix cleanup of pipe in GetObjectNInfo handlers (#6509)

This commit is contained in:
Aditya Manthramurthy
2018-09-21 11:42:06 -07:00
committed by kannappanr
parent 36e51d0cee
commit 3c8fabd116
9 changed files with 34 additions and 9 deletions

View File

@@ -211,8 +211,11 @@ func (xl xlObjects) GetObjectNInfo(ctx context.Context, bucket, object string, r
err := xl.getObject(ctx, bucket, object, off, length, pw, "", ObjectOptions{})
pw.CloseWithError(err)
}()
// Cleanup function to cause the go routine above to exit, in
// case of incomplete read.
pipeCloser := func() { pr.Close() }
return fn(pr, h)
return fn(pr, h, pipeCloser)
}
// GetObject - reads an object erasured coded across multiple