mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
commit
85570f27a0
|
@ -99,7 +99,7 @@ func init() {
|
||||||
serverOptions.v.fileSizeLimitMB = cmdServer.Flag.Int("volume.fileSizeLimitMB", 1024, "limit file size to avoid out of memory")
|
serverOptions.v.fileSizeLimitMB = cmdServer.Flag.Int("volume.fileSizeLimitMB", 1024, "limit file size to avoid out of memory")
|
||||||
serverOptions.v.publicUrl = cmdServer.Flag.String("volume.publicUrl", "", "publicly accessible address")
|
serverOptions.v.publicUrl = cmdServer.Flag.String("volume.publicUrl", "", "publicly accessible address")
|
||||||
serverOptions.v.preStopSeconds = cmdServer.Flag.Int("volume.preStopSeconds", 10, "number of seconds between stop send heartbeats and stop volume server")
|
serverOptions.v.preStopSeconds = cmdServer.Flag.Int("volume.preStopSeconds", 10, "number of seconds between stop send heartbeats and stop volume server")
|
||||||
serverOptions.v.pprof = &False
|
serverOptions.v.pprof = cmdServer.Flag.Bool("volume.pprof", false, "enable pprof http handlers. precludes --memprofile and --cpuprofile")
|
||||||
|
|
||||||
s3Options.port = cmdServer.Flag.Int("s3.port", 8333, "s3 server http listen port")
|
s3Options.port = cmdServer.Flag.Int("s3.port", 8333, "s3 server http listen port")
|
||||||
s3Options.domainName = cmdServer.Flag.String("s3.domainName", "", "suffix of the host name, {bucket}.{domainName}")
|
s3Options.domainName = cmdServer.Flag.String("s3.domainName", "", "suffix of the host name, {bucket}.{domainName}")
|
||||||
|
|
|
@ -23,7 +23,7 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector
|
||||||
// find local old entry
|
// find local old entry
|
||||||
oldEntry, err := dir.wfs.metaCache.FindEntry(context.Background(), oldPath)
|
oldEntry, err := dir.wfs.metaCache.FindEntry(context.Background(), oldPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.V(0).Infof("dir Rename can not find source %s : %v", oldPath, err)
|
glog.Errorf("dir Rename can not find source %s : %v", oldPath, err)
|
||||||
return fuse.ENOENT
|
return fuse.ENOENT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector
|
||||||
|
|
||||||
_, err := client.AtomicRenameEntry(ctx, request)
|
_, err := client.AtomicRenameEntry(ctx, request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
glog.Errorf("dir AtomicRenameEntry %s => %s : %v", oldPath, newPath, err)
|
||||||
return fuse.EIO
|
return fuse.EIO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,8 @@ func (ms *MasterServer) KeepConnected(stream master_pb.Seaweed_KeepConnectedServ
|
||||||
|
|
||||||
peerAddress := findClientAddress(stream.Context(), req.GrpcPort)
|
peerAddress := findClientAddress(stream.Context(), req.GrpcPort)
|
||||||
|
|
||||||
stopChan := make(chan bool)
|
// buffer by 1 so we don't end up getting stuck writing to stopChan forever
|
||||||
|
stopChan := make(chan bool, 1)
|
||||||
|
|
||||||
clientName, messageChan := ms.addClient(req.Name, peerAddress)
|
clientName, messageChan := ms.addClient(req.Name, peerAddress)
|
||||||
|
|
||||||
|
@ -247,7 +248,12 @@ func (ms *MasterServer) addClient(clientType string, clientAddress string) (clie
|
||||||
clientName = clientType + "@" + clientAddress
|
clientName = clientType + "@" + clientAddress
|
||||||
glog.V(0).Infof("+ client %v", clientName)
|
glog.V(0).Infof("+ client %v", clientName)
|
||||||
|
|
||||||
messageChan = make(chan *master_pb.VolumeLocation)
|
// we buffer this because otherwise we end up in a potential deadlock where
|
||||||
|
// the KeepConnected loop is no longer listening on this channel but we're
|
||||||
|
// trying to send to it in SendHeartbeat and so we can't lock the
|
||||||
|
// clientChansLock to remove the channel and we're stuck writing to it
|
||||||
|
// 100 is probably overkill
|
||||||
|
messageChan = make(chan *master_pb.VolumeLocation, 100)
|
||||||
|
|
||||||
ms.clientChansLock.Lock()
|
ms.clientChansLock.Lock()
|
||||||
ms.clientChans[clientName] = messageChan
|
ms.clientChans[clientName] = messageChan
|
||||||
|
|
Loading…
Reference in a new issue