Merge pull request #2034 from yichengq/276

etcdhttp: reset serve and watch timeout
release-2.0
Yicheng Qin 2015-01-05 08:33:25 -08:00
commit cb5bff5b05
1 changed files with 6 additions and 2 deletions

View File

@ -19,6 +19,7 @@ package etcdhttp
import (
"errors"
"log"
"math"
"net/http"
"strings"
"time"
@ -29,10 +30,13 @@ import (
const (
// 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
defaultWatchTimeout = 5 * time.Minute
defaultWatchTimeout = time.Duration(math.MaxInt64)
)
var errClosed = errors.New("etcdhttp: client closed connection")