etcdhttp: reset serve and watch timeout

This commit is contained in:
Yicheng Qin 2015-01-02 10:56:01 -08:00
parent 7273a861a6
commit 4dd00be365

View File

@ -19,6 +19,7 @@ package etcdhttp
import ( import (
"errors" "errors"
"log" "log"
"math"
"net/http" "net/http"
"strings" "strings"
"time" "time"
@ -29,10 +30,13 @@ import (
const ( const (
// time to wait for response from EtcdServer requests // time to wait for response from EtcdServer requests
defaultServerTimeout = 5 * time.Minute // 5s for disk and network delay + 10*heartbeat for commit and possible
// leader switch
// TODO: use heartbeat set in etcdserver
defaultServerTimeout = 5*time.Second + 10*(100*time.Millisecond)
// time to wait for a Watch request // time to wait for a Watch request
defaultWatchTimeout = 5 * time.Minute defaultWatchTimeout = time.Duration(math.MaxInt64)
) )
var errClosed = errors.New("etcdhttp: client closed connection") var errClosed = errors.New("etcdhttp: client closed connection")