mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
No retries if minio server is down/connection refused err (#11809)
This commit is contained in:
parent
eed3b66d98
commit
32b088a2ff
@ -34,6 +34,7 @@ import (
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
@ -340,7 +341,6 @@ var successStatus = []int{
|
||||
// delayed manner using a standard back off algorithm.
|
||||
func (adm AdminClient) executeMethod(ctx context.Context, method string, reqData requestData) (res *http.Response, err error) {
|
||||
var reqRetry = MaxRetry // Indicates how many times we can retry the request
|
||||
|
||||
defer func() {
|
||||
if err != nil {
|
||||
// close idle connections before returning, upon error.
|
||||
@ -365,6 +365,10 @@ func (adm AdminClient) executeMethod(ctx context.Context, method string, reqData
|
||||
// Initiate the request.
|
||||
res, err = adm.do(req)
|
||||
if err != nil {
|
||||
// Give up right away if it is a connection refused problem
|
||||
if errors.Is(err, syscall.ECONNREFUSED) {
|
||||
return nil, err
|
||||
}
|
||||
if err == context.Canceled || err == context.DeadlineExceeded {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user