raft: adding idle connection time out

another attempt to fix https://github.com/chrislusf/seaweedfs/issues/825
This commit is contained in:
Chris Lu 2019-01-22 09:25:25 -08:00
parent 69c1e9b4ba
commit 3f56b12ed4

View file

@ -44,6 +44,7 @@ func NewRaftServer(r *mux.Router, peers []string, httpAddr string, dataDir strin
var err error
transporter := raft.NewHTTPTransporter("/cluster", time.Second)
transporter.Transport.MaxIdleConnsPerHost = 1024
transporter.Transport.IdleConnTimeout = time.Second
glog.V(0).Infof("Starting RaftServer with %v", httpAddr)
// Clear old cluster configurations if peers are changed