mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
reduce the connections
fix https://github.com/chrislusf/seaweedfs/issues/1277 this avoids sending error to wdclients, and clients retry the connections
This commit is contained in:
parent
aebe39a803
commit
69eda558ef
|
@ -11,7 +11,6 @@ import (
|
||||||
"google.golang.org/grpc/peer"
|
"google.golang.org/grpc/peer"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/storage/backend"
|
"github.com/chrislusf/seaweedfs/weed/storage/backend"
|
||||||
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
||||||
|
@ -191,18 +190,6 @@ func (ms *MasterServer) KeepConnected(stream master_pb.Seaweed_KeepConnectedServ
|
||||||
|
|
||||||
peerAddress := findClientAddress(stream.Context(), req.GrpcPort)
|
peerAddress := findClientAddress(stream.Context(), req.GrpcPort)
|
||||||
|
|
||||||
// only one shell can be connected at any time
|
|
||||||
if req.Name == pb.AdminShellClient {
|
|
||||||
if ms.currentAdminShellClient == "" {
|
|
||||||
ms.currentAdminShellClient = peerAddress
|
|
||||||
defer func() {
|
|
||||||
ms.currentAdminShellClient = ""
|
|
||||||
}()
|
|
||||||
} else {
|
|
||||||
return fmt.Errorf("only one concurrent shell allowed, but another shell is already connected from %s", peerAddress)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stopChan := make(chan bool)
|
stopChan := make(chan bool)
|
||||||
|
|
||||||
clientName, messageChan := ms.addClient(req.Name, peerAddress)
|
clientName, messageChan := ms.addClient(req.Name, peerAddress)
|
||||||
|
|
Loading…
Reference in a new issue