kubernetes-client/python

Set tcp keepalive for http connections

開放

#2,067 建立於 2023年6月6日

 (4 則留言) (7 個反應) (0 位負責人)Python (3,323 個分叉)batch import
help wantedkind/feature

倉庫指標

星標
 (6,225 顆星)
PR 合併指標
 (平均合併 10天 3小時) (30 天內合併 2 個 PR)

描述

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

貢獻者指南