Content cache keeps answering 404 after orphan cleanup removed the artifact
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start in AsyncContentCache.make_response(), where a cached ArtifactResponse is returned as a 404 without checking whether its artifact_pk still exists, then read the orphans/cleanup task to see how it deletes artifacts. Reproduce by fetching a wheel through a pull-through distribution, running orphan cleanup with protection time 0, and fetching again. Done when a cached entry whose artifact is gone is dropped and the request falls through to the handler, or the cleanup invalidates the cache, with a test covering it. The maintainers still need to choose between the two fixes.
由索引模型根据 Issue 内容生成。
描述
Versions: pulpcore 3.118.1, CACHE_ENABLED = True, default CACHE_SETTINGS["EXPIRES_TTL"] = 600.
A pull-through file that is served (and cached as an ArtifactResponse, which stores artifact_pk) and then removed by orphans/cleanup with orphan_protection_time: 0 keeps being answered from the cache as 404 Not Found, X-PULP-CACHE: HIT, empty body, until the entry expires. Upstream still has the file; a cache miss would simply pull it through again.
Reproduce: fetch a wheel through a Python pull-through distribution that has no repository, run pulp orphan cleanup --protection-time 0, fetch the same URL again within ten minutes.
Suggested fix: in AsyncContentCache.make_response(), treat an ArtifactResponse entry whose artifact no longer exists as a bad entry (delete it and fall through to the handler) instead of returning the 404; and/or have the orphan cleanup task invalidate the content cache when it deletes artifacts.
Workaround we deployed: delete the cache hash of every distribution (Cache().delete(base_key=[...])) right after each orphan cleanup.
Related: https://github.com/pulp/pulp_python/issues/1428 (found while validating the workaround for that issue).
- 主要语言
- Python
- 星标
- 606
- 派生
- 174
- 平均合并
- 16 小时 44 分钟
- 30 天内合并 PR
- 107
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pulp/pulpcore 的其他 Issue
-
Issue
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Feature
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
Content app answers 404 instead of 502 when the remote of on-demand content is unavailable可能已有人在做 @gigi206 于 1 天前认领。 未关闭
难度 3/5 半天 新手友好度 66/100
维护者通常 1 天内回复
-
Performance Task Triage-Needed
难度 5/5 一周以上 新手友好度 25/100
pulp/pulpcore#8206 · 3 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
Issue Triage-Needed
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
md/asciidoc/csv: an explicit `encoding="utf-8"` keeps a leading BOM, the auto-detect path drops it未关闭
难度 2/5 1-3 小时 新手友好度 82/100
docling-project/docling#4846 ·
维护者通常 1 天内回复
-
area/sessions comp/dashboard comp/desktop comp/gateway comp/tui duplicate P2 sweeper:risk-session-state type/bug
难度 2/5 1-3 小时 新手友好度 78/100
NousResearch/hermes-agent#138914 · 1 条评论 ·
维护者通常 1 天内回复
-
bot-triaged module: activation checkpointing module: inductor oncall: pt2 triaged
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
[oblt-aw][autodoc] Update PR Actions Detective E2E prerequisites and fix dashboard-format table typo未关闭documentation
难度 2/5 1-3 小时 新手友好度 75/100
elastic/oblt-aw#2382 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复