diff --git a/README.md b/README.md index 8e73f811c..923331853 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ![SeaweedFS Logo](https://raw.githubusercontent.com/chrislusf/seaweedfs/master/note/seaweedfs.png) -

Supporting SeaweedFS

+

Sponsor SeaweedFS via Patreon

SeaweedFS is an independent Apache-licensed open source project with its ongoing development made possible entirely thanks to the support of these awesome [backers](https://github.com/chrislusf/seaweedfs/blob/master/backers.md). @@ -17,8 +17,6 @@ If you'd like to grow SeaweedFS even stronger, please consider joining our Your support will be really appreciated by me and other supporters! -

Sponsor SeaweedFS via Patreon

- + +### Gold Sponsors +![shuguang](https://raw.githubusercontent.com/chrislusf/seaweedfs/master/note/shuguang.png) + --- diff --git a/docker/Dockerfile.go_build b/docker/Dockerfile.go_build index 29b9a85d8..a5f8725e0 100644 --- a/docker/Dockerfile.go_build +++ b/docker/Dockerfile.go_build @@ -2,6 +2,8 @@ FROM frolvlad/alpine-glibc as builder RUN apk add git go g++ RUN mkdir -p /go/src/github.com/chrislusf/ RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs +ARG branch=${branch:-master} +RUN cd /go/src/github.com/chrislusf/seaweedfs && git checkout $ARG RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \ && export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \ && go install -ldflags "${LDFLAGS}" diff --git a/docker/Dockerfile.go_build_large b/docker/Dockerfile.go_build_large index fa22aeade..c3ea4e606 100644 --- a/docker/Dockerfile.go_build_large +++ b/docker/Dockerfile.go_build_large @@ -2,6 +2,8 @@ FROM frolvlad/alpine-glibc as builder RUN apk add git go g++ RUN mkdir -p /go/src/github.com/chrislusf/ RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs +ARG branch=${branch:-master} +RUN cd /go/src/github.com/chrislusf/seaweedfs && git checkout $ARG RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \ && export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \ && go install -tags 5BytesOffset -ldflags "${LDFLAGS}" diff --git a/note/shuguang.png b/note/shuguang.png new file mode 100644 index 000000000..54b6d0b6b Binary files /dev/null and b/note/shuguang.png differ diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go index cc356de88..1b5f4c849 100644 --- a/weed/command/filer_copy.go +++ b/weed/command/filer_copy.go @@ -159,7 +159,7 @@ func runCopy(cmd *Command, args []string) bool { defer close(fileCopyTaskChan) for _, fileOrDir := range fileOrDirs { if err := genFileCopyTask(fileOrDir, urlPath, fileCopyTaskChan); err != nil { - fmt.Fprintf(os.Stderr, "gen file list error: %v\n", err) + fmt.Fprintf(os.Stderr, "genFileCopyTask : %v\n", err) break } } @@ -202,7 +202,7 @@ func genFileCopyTask(fileOrDir string, destPath string, fileCopyTaskChan chan Fi fi, err := os.Stat(fileOrDir) if err != nil { - fmt.Fprintf(os.Stderr, "Failed to get stat for file %s: %v\n", fileOrDir, err) + fmt.Fprintf(os.Stderr, "Error: read file %s: %v\n", fileOrDir, err) return nil } diff --git a/weed/server/filer_server_handlers_write_autochunk.go b/weed/server/filer_server_handlers_write_autochunk.go index e52e20a8a..0cfbeba47 100644 --- a/weed/server/filer_server_handlers_write_autochunk.go +++ b/weed/server/filer_server_handlers_write_autochunk.go @@ -57,7 +57,11 @@ func (fs *FilerServer) autoChunk(ctx context.Context, w http.ResponseWriter, r * reply, md5bytes, err = fs.doPutAutoChunk(ctx, w, r, chunkSize, so) } if err != nil { - writeJsonError(w, r, http.StatusInternalServerError, err) + if strings.HasPrefix(err.Error(), "read input:") { + writeJsonError(w, r, 499, err) + } else { + writeJsonError(w, r, http.StatusInternalServerError, err) + } } else if reply != nil { if len(md5bytes) > 0 { w.Header().Set("Content-MD5", util.Base64Encode(md5bytes)) diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go index 7030900dc..c6619b260 100644 --- a/weed/storage/disk_location.go +++ b/weed/storage/disk_location.go @@ -101,12 +101,14 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne } // avoid loading one volume more than once - l.volumesLock.RLock() - _, found := l.volumes[vid] - l.volumesLock.RUnlock() - if found { + l.volumesLock.Lock() + if _, found := l.volumes[vid]; found { + l.volumesLock.Unlock() glog.V(1).Infof("loaded volume, %v", vid) return true + } else { + l.volumes[vid] = nil + l.volumesLock.Unlock() } // load the volume @@ -115,7 +117,7 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne glog.V(0).Infof("new volume %s error %s", volumeName, e) return false } - + l.SetVolume(vid, v) size, _, _ := v.FileStat()