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

Content cache keeps answering 404 after orphan cleanup removed the artifact

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

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

环境准备

从这里开始

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

pulp/pulpcore 的其他 Issue

查看 pulp/pulpcore 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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