aboutsummaryrefslogtreecommitdiff
path: root/weed/operation
diff options
context:
space:
mode:
authorwusong <75450248+wusongANKANG@users.noreply.github.com>2023-04-21 15:09:31 +0800
committerGitHub <noreply@github.com>2023-04-21 00:09:31 -0700
commit19245dde505bdcd887fa7719d9f6e2bca92ced42 (patch)
treeb601aa1764cba124aa1bd70dcd557197f133e0ba /weed/operation
parent4131874fa8844d1ed6d71ae1cc839f2fc71a81d2 (diff)
downloadseaweedfs-19245dde505bdcd887fa7719d9f6e2bca92ced42.tar.xz
seaweedfs-19245dde505bdcd887fa7719d9f6e2bca92ced42.zip
mount: add retry for read only case (#4416)
* mount: add retry for read only case Signed-off-by: Wusong Wang <wangwusong@virtaitech.com> * add new util retry function for mount Signed-off-by: Wusong Wang <wangwusong@virtaitech.com> * change error list param Signed-off-by: Wusong Wang <wangwusong@virtaitech.com> --------- Signed-off-by: Wusong Wang <wangwusong@virtaitech.com> Co-authored-by: Wusong Wang <wangwusong@virtaitech.com>
Diffstat (limited to 'weed/operation')
-rw-r--r--weed/operation/upload_content.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go
index 0c3e29a43..17e767472 100644
--- a/weed/operation/upload_content.go
+++ b/weed/operation/upload_content.go
@@ -5,11 +5,6 @@ import (
"context"
"encoding/json"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/glog"
- "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
- "github.com/seaweedfs/seaweedfs/weed/security"
- "github.com/seaweedfs/seaweedfs/weed/stats"
- "github.com/seaweedfs/seaweedfs/weed/util"
"io"
"mime"
"mime/multipart"
@@ -19,6 +14,12 @@ import (
"path/filepath"
"strings"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
+ "github.com/seaweedfs/seaweedfs/weed/security"
+ "github.com/seaweedfs/seaweedfs/weed/stats"
+ "github.com/seaweedfs/seaweedfs/weed/util"
)
type UploadOption struct {
@@ -120,7 +121,8 @@ func UploadWithRetry(filerClient filer_pb.FilerClient, assignRequest *filer_pb.A
return true
})
} else {
- err = util.Retry("uploadWithRetry", doUploadFunc)
+ uploadErrList := []string{"transport", "is read only"}
+ err = util.MultiRetry("uploadWithRetry", uploadErrList, doUploadFunc)
}
return