tier verification leaks fd, that must be closed (#16296)

Co-authored-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
jiuker 2022-12-23 02:35:54 +08:00 committed by GitHub
parent 6423e4c767
commit 29dd7f1d68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ import (
"io"
"github.com/minio/madmin-go/v2"
xhttp "github.com/minio/minio/internal/http"
)
// WarmBackendGetOpts is used to express byte ranges within an object. The zero
@ -60,7 +61,8 @@ func checkWarmBackend(ctx context.Context, w WarmBackend) error {
}
}
_, err = w.Get(ctx, probeObject, rv, WarmBackendGetOpts{})
r, err := w.Get(ctx, probeObject, rv, WarmBackendGetOpts{})
xhttp.DrainBody(r)
if err != nil {
switch err.(type) {
case BackendDown:
@ -78,7 +80,6 @@ func checkWarmBackend(ctx context.Context, w WarmBackend) error {
}
}
}
if err = w.Remove(ctx, probeObject, rv); err != nil {
switch err.(type) {
case BackendDown: