stackset-controller icon indicating copy to clipboard operation
stackset-controller copied to clipboard

fix transport issue with WATCH

Open szuecs opened this issue 5 years ago • 0 comments

Original issue https://github.com/kubernetes/client-go/issues/374#issuecomment-716846816 This could cause no update for 30 minutes... Recent comments suggest that we can fix it and use http2 Transport for connecting to kube-apiserver and set ReadIdleTimeout: https://github.com/golang/net/blob/release-branch.go1.15/http2/transport.go#L117

we would need to switch all controllers that rely on WATCH to Go1.15 in order to fix this

import 	"golang.org/x/net/http2"
func configureKubeConfig(apiServerURL *url.URL, timeout time.Duration, stopCh <-chan struct{}) (*rest.Config, error) {
	tr := &http2.Transport{
                 ....
		ReadIdleTimeout:       10 * time.Second,   // <--
	}

...
}

szuecs avatar Oct 28 '20 19:10 szuecs