diff options
| author | chrislu <chris.lu@gmail.com> | 2022-03-15 22:28:21 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-03-15 22:28:21 -0700 |
| commit | ed818c90a93e5d5294e0072c9538e5e0de692131 (patch) | |
| tree | b45072bd539671ef7f3ac1577892dd92475fdb1d | |
| parent | 3639cad69cf58f7161aff2a639829c195d08ec30 (diff) | |
| parent | fa6fe327bfe2782427646f54894ed5bddbe412e4 (diff) | |
| download | seaweedfs-ed818c90a93e5d5294e0072c9538e5e0de692131.tar.xz seaweedfs-ed818c90a93e5d5294e0072c9538e5e0de692131.zip | |
Merge branch 'master' of https://github.com/chrislusf/seaweedfs
| -rw-r--r-- | weed/operation/upload_content.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index 569a54372..3d41d2eb5 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -11,6 +11,7 @@ import ( "io" "mime" "mime/multipart" + "net" "net/http" "net/textproto" "path/filepath" @@ -65,6 +66,10 @@ var ( func init() { HttpClient = &http.Client{Transport: &http.Transport{ + DialContext: (&net.Dialer{ + Timeout: 10 * time.Second, + KeepAlive: 10 * time.Second, + }).DialContext, MaxIdleConns: 1024, MaxIdleConnsPerHost: 1024, }} @@ -261,6 +266,7 @@ func upload_content(fillBufferFunction func(w io.Writer) error, originalDataSize if post_err != nil { if strings.Contains(post_err.Error(), "connection reset by peer") || strings.Contains(post_err.Error(), "use of closed network connection") { + glog.V(1).Infof("repeat error upload request %s: %v", option.UploadUrl, postErr) resp, post_err = HttpClient.Do(req) } } |
