mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
Default minRequestTimeout to 1800s
This commit is contained in:
@@ -69,8 +69,8 @@ func (w *realTimeoutFactory) TimeoutCh() (<-chan time.Time, func() bool) {
|
||||
func serveWatch(watcher watch.Interface, scope RequestScope, w http.ResponseWriter, req *restful.Request, minRequestTimeout int) {
|
||||
var timeout time.Duration
|
||||
if minRequestTimeout > 0 {
|
||||
// Each watch gets a random timeout to avoid thundering herds. Rand is seeded once in the api installer.
|
||||
timeout = time.Duration(minRequestTimeout+rand.Intn(2*minRequestTimeout-minRequestTimeout)) * time.Second
|
||||
// Each watch gets a random timeout between minRequestTimeout and 2*minRequestTimeout to avoid thundering herds.
|
||||
timeout = time.Duration(minRequestTimeout+rand.Intn(minRequestTimeout)) * time.Second
|
||||
}
|
||||
watchServer := &WatchServer{watcher, scope.Codec, func(obj runtime.Object) {
|
||||
if err := setSelfLink(obj, req, scope.Namer); err != nil {
|
||||
|
Reference in New Issue
Block a user