Skip to content

Commit efb88a8

Browse files
fuweidthaJeztah
authored andcommitted
pkg/cri/streaming: increase ReadHeaderTimeout
It is follow-up of #7254. This commit will increase ReadHeaderTimeout from 3s to 30m, which prevent from unexpected timeout when the node is running with high-load. 30 Minutes is longer enough to get close to before what #7254 changes. And ideally, we should allow user to configure the streaming server if the users want this feature. Signed-off-by: Wei Fu <[email protected]> (cherry picked from commit 460b053) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 45f055d commit efb88a8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

pkg/cri/streaming/server.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,11 @@ func NewServer(config Config, runtime Runtime) (Server, error) {
162162
handler.Add(ws)
163163
s.handler = handler
164164
s.server = &http.Server{
165-
Addr: s.config.Addr,
166-
Handler: s.handler,
167-
TLSConfig: s.config.TLSConfig,
168-
ReadHeaderTimeout: 3 * time.Second, // Fix linter G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server
165+
Addr: s.config.Addr,
166+
Handler: s.handler,
167+
TLSConfig: s.config.TLSConfig,
168+
// TODO(fuweid): allow user to configure streaming server
169+
ReadHeaderTimeout: 30 * time.Minute, // Fix linter G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server
169170
}
170171

171172
return s, nil

0 commit comments

Comments
 (0)