Skip to content

Commit

Permalink
fix http client credential problem
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunzhu committed Nov 3, 2021
1 parent fb33b7c commit 8f78489
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions dumpling/export/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"regexp"
"strconv"
"strings"
Expand All @@ -21,11 +20,12 @@ import (
"github.com/pingcap/errors"
filter "github.com/pingcap/tidb-tools/pkg/table-filter"
"github.com/pingcap/tidb-tools/pkg/utils"
"github.com/pingcap/tidb/br/pkg/storage"
tcontext "github.com/pingcap/tidb/dumpling/context"
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/pflag"
"go.uber.org/zap"

"github.com/pingcap/tidb/br/pkg/storage"
tcontext "github.com/pingcap/tidb/dumpling/context"
)

const (
Expand Down Expand Up @@ -531,21 +531,8 @@ func (conf *Config) createExternalStorage(ctx context.Context) (storage.External
if err != nil {
return nil, errors.Trace(err)
}
httpClient := http.DefaultClient
httpClient.Timeout = 30 * time.Second
maxIdleConnsPerHost := http.DefaultMaxIdleConnsPerHost
if conf.Threads > maxIdleConnsPerHost {
maxIdleConnsPerHost = conf.Threads
}
transport := http.DefaultTransport.(*http.Transport).Clone()
transport.MaxIdleConnsPerHost = maxIdleConnsPerHost
httpClient.Transport = transport

return storage.New(ctx, b, &storage.ExternalStorageOptions{
HTTPClient: httpClient,
SkipCheckPath: true,
SendCredentials: false,
})

return storage.New(ctx, b, &storage.ExternalStorageOptions{})
}

const (
Expand Down

0 comments on commit 8f78489

Please sign in to comment.