Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Content cache keeps answering 404 after orphan cleanup removed the artifact

Aperta
#8,214 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
28/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).

Lingua principale
Python
Stelle
606
Fork
174
Merge medio
16h 44m
PR unite (30g)
107

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pulp/pulpcore

Tutte le issue di pulp/pulpcore

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.