chore(etcd): loose request timeout

This is a hack to improve multi-etcd boot process.
It could make users alwasy start etcd cluster successfully.
This commit is contained in:
Yicheng Qin 2014-04-15 11:31:44 -07:00
parent 26c77fcf9e
commit 3a5cb26973

View File

@ -134,8 +134,14 @@ func (e *Etcd) Run() {
// Calculate all of our timeouts // Calculate all of our timeouts
heartbeatInterval := time.Duration(e.Config.Peer.HeartbeatInterval) * time.Millisecond heartbeatInterval := time.Duration(e.Config.Peer.HeartbeatInterval) * time.Millisecond
electionTimeout := time.Duration(e.Config.Peer.ElectionTimeout) * time.Millisecond electionTimeout := time.Duration(e.Config.Peer.ElectionTimeout) * time.Millisecond
dialTimeout := (3 * heartbeatInterval) + electionTimeout // TODO(yichengq): constant 1000 is a hack here. The reason to use this
responseHeaderTimeout := (3 * heartbeatInterval) + electionTimeout // is to ensure etcd instances could start successfully at the same time.
// Current problem for the failure comes from the lag between join command
// execution and join success.
// Fix it later. It should be removed when proper method is found and
// enough tests are provided.
dialTimeout := (3 * heartbeatInterval) + electionTimeout + 1000
responseHeaderTimeout := (3 * heartbeatInterval) + electionTimeout + 1000
// Create peer server // Create peer server
psConfig := server.PeerServerConfig{ psConfig := server.PeerServerConfig{