kubernetes-client/python

Set tcp keepalive for http connections

Open

#2.067 geöffnet am 6. Juni 2023

Auf GitHub ansehen
 (4 Kommentare) (7 Reaktionen) (0 zugewiesene Personen)Python (3.323 Forks)batch import
help wantedkind/feature

Repository-Metriken

Stars
 (6.225 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 10T 3h) (2 gemergte PRs in 30 T)

Beschreibung

What is the feature and why do you need it:

Currently when a watch is opened to the kubernetes api we do not send regular keepalives on the connection. That means that if the watch is not receiving any updates a reverse proxy in the path might terminate the tcp connection.

The go client is currently sending a tcp keepalive every 30 seconds: https://github.com/kubernetes/client-go/blob/release-1.27/transport/cache.go#L104-L107

Describe the solution you'd like to see:

On linux set a socket options to update the keepalive time, just like it is done in go here: https://go.dev/src/net/tcpsockopt_unix.go

I do not have particular feelings regarding other operating systems

Contributor Guide