Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Configure default timeout for all API calls

未关闭
#1,961 30 条评论 8 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 3 天内回复

@yliaog 已经在做这个了。

开始于 2022年12月5日。

评估

这个 Issue 还没有评估数据。

描述

kind/feature lifecycle/stale

What is the feature and why do you need it:
All API calls done through this client today goes through urllib3, where the timeout is default to set to None, this means infinite timeout and is a well known pitfall with urllib3. Lost connection attempts can get stuck waiting forever, with no retries being done to reestablish the connection.

Quoting the requests-documentation which uses urllib3 under the hood:

Nearly all production code should use this parameter in nearly all requests. Failure to do so can cause your program to hang indefinitely:


There is a _request_timeout kwargs argument that can be set on each api-call, but that is both tedious, easy to forget and not type-checked due to use of kwargs-dictionarly.

Describe the solution you'd like to see:
Similar to how retries is configured, Configuration should accept a timeout-argument, this can be forwarded into urllib3s poolmanager where it uses this timeout for all operations where an explicit timeout is not provided.

主要语言
Python
星标
7.7k
派生
3.5k
平均合并
3 天 4 小时
30 天内合并 PR
9

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

kubernetes-client/python 的其他 Issue

查看 kubernetes-client/python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。