Redis client has no socket timeouts, so a lost Redis connection stalls content requests for minutes

未关闭
#8,347 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
半天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python, redis
领域
backend

调研方向

Start with redis_connection.py, where the Redis client is built from REDIS_HOST and REDIS_PORT without socket timeouts, and check how REDIS_URL is parsed as an alternative path. Read the cache layer that falls back to the database when Redis raises an error, to confirm where the failure surfaces. Reproduce by pointing the client at an address that does not answer and timing a cache call. Done when the host-based client sets connect and socket timeouts and a health check, and the REDIS_URL options are documented.

由索引模型根据 Issue 内容生成。

描述

Issue Triage-Needed

redis_connection.py builds the client with REDIS_HOST/REDIS_PORT and no socket_timeout, socket_connect_timeout, socket_keepalive or health_check_interval. Every content request consults the cache, and the cache serves the request without Redis when Redis raises an error. With no timeouts, nothing is raised when the Redis server disappears without closing its connections (node loss, network partition): a request on such a pooled connection waits until TCP gives up, which takes minutes, and new connections wait for the OS connect timeout.

Measured with redis-py 8.1 against an address that does not answer: a cache call fails after about 20 s without options and after about 4 s with socket_connect_timeout=1&socket_timeout=2 in REDIS_URL (three retries).

Suggestion: default timeouts and a health check when the client is built from REDIS_HOST, and documenting the REDIS_URL query options for deployments that set it.

主要语言
Python
星标
641
派生
178
平均合并
17 小时 36 分钟
30 天内合并 PR
76

环境准备

从这里开始

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

pulp/pulpcore 的其他 Issue

查看 pulp/pulpcore 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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