diff options
| author | LHHDZ <changlin.shi@ly.com> | 2022-06-20 13:42:18 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-20 13:42:18 +0800 |
| commit | 8db9f13bc69be974fbd18c4b0aacd071ea1acaa9 (patch) | |
| tree | e84927ea360a7ede80d13fe7aada59356c0475ce /weed/server/volume_server.go | |
| parent | 9e036df3566e842710ea2b0ed3ad28f5af2a1885 (diff) | |
| parent | 1baa7ead59a0a040d1165e3579cf79f90c20dd65 (diff) | |
| download | seaweedfs-8db9f13bc69be974fbd18c4b0aacd071ea1acaa9.tar.xz seaweedfs-8db9f13bc69be974fbd18c4b0aacd071ea1acaa9.zip | |
Merge branch 'master' into circuit_breaker
Diffstat (limited to 'weed/server/volume_server.go')
| -rw-r--r-- | weed/server/volume_server.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/server/volume_server.go b/weed/server/volume_server.go index 477a3709c..abb30229a 100644 --- a/weed/server/volume_server.go +++ b/weed/server/volume_server.go @@ -3,6 +3,7 @@ package weed_server import ( "net/http" "sync" + "time" "github.com/chrislusf/seaweedfs/weed/pb" "github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb" @@ -24,7 +25,9 @@ type VolumeServer struct { inFlightDownloadDataSize int64 concurrentUploadLimit int64 concurrentDownloadLimit int64 + inFlightUploadDataLimitCond *sync.Cond inFlightDownloadDataLimitCond *sync.Cond + inflightUploadDataTimeout time.Duration SeedMasterNodes []pb.ServerAddress currentMaster pb.ServerAddress @@ -60,6 +63,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, fileSizeLimitMB int, concurrentUploadLimit int64, concurrentDownloadLimit int64, + inflightUploadDataTimeout time.Duration, ) *VolumeServer { v := util.GetViper() @@ -84,9 +88,11 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, fileSizeLimitBytes: int64(fileSizeLimitMB) * 1024 * 1024, isHeartbeating: true, stopChan: make(chan bool), + inFlightUploadDataLimitCond: sync.NewCond(new(sync.Mutex)), inFlightDownloadDataLimitCond: sync.NewCond(new(sync.Mutex)), concurrentUploadLimit: concurrentUploadLimit, concurrentDownloadLimit: concurrentDownloadLimit, + inflightUploadDataTimeout: inflightUploadDataTimeout, } vs.SeedMasterNodes = masterNodes |
