Repository navigation
Set IdleTimeout on the supervisor http server - #14904
Merged
Merged
Conversation
Signed-off-by: somaz <[email protected]>
somaz94
added a commit
to somaz94/somaz94
that referenced
this pull request
Oct 26, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14904 +/- ##
==========================================
- Coverage 52.14% 49.29% -2.85%
==========================================
Files 197 197
Lines 16013 16013
==========================================
- Hits 8350 7894 -456
- Misses 6357 6906 +549
+ Partials 1306 1213 -93
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Any particular reason this is still in draft? |
brandond
requested changes
Oct 28, 2026
Signed-off-by: Brad Davidson <[email protected]>
brandond
marked this pull request as ready for review
October 28, 2026 00:17
brandond
reviewed
Oct 28, 2026
Comment on lines
+125
to
+128
| // Same values as kubernetes apiserver | ||
| MaxHeaderBytes: 1 << 20, | ||
| IdleTimeout: 90 * time.Second, | ||
| ReadHeaderTimeout: 32 * time.Second, |
Member
There was a problem hiding this comment.
I will also note that (unlike upstream) we are not serving with http/2 on this port. Maybe someday we might want to do that.
brandond
approved these changes
Oct 28, 2026
vitorsavian
approved these changes
Oct 28, 2026
Member
|
tests flaked due to #14915 - merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
The supervisor http.Server on 6443 sets no IdleTimeout, so net/http never closes an idle keep-alive connection, for HTTP/1.1 or HTTP/2. A client that goes away without the server seeing a FIN leaves the connection and its goroutines on the server until restart. This sets IdleTimeout to 90 seconds, the value kube-apiserver uses on its own secure serving http.Server. Because the listener negotiates h2 and the server is left to configure HTTP/2 itself, the same field also applies to HTTP/2 connections.
Types of Changes
Bugfix
Verification
With the dynamiclistener TLS listener and the same NextProtos as newListener, a connection that has served one request and then sits idle stays open indefinitely with IdleTimeout unset, on both http/1.1 and h2. With IdleTimeout set, the server closes it once the timeout passes. A response that keeps streaming for longer than the timeout (the shape of a watch) is not cut off on either protocol, since the idle timeout only applies between requests. The reproduction in #14901 (one keep-alive request to 6443 and 6444, then wait) should now show 6443 closing after about 90 seconds, like 6444.
Testing
No unit test added: the change is one field on the server struct, and a test that waits out a real 90 second timeout or only asserts the field value would not add much. go test ./pkg/cluster/ passes on linux/arm64 with Go 1.26, and go vet and golangci-lint on pkg/cluster report nothing new.
Linked Issues
#14901
User-Facing Change
Further Comments
I used Claude Code to help prepare this change and checked the result myself, including the verification above.