Queue-ring pruning leaves unique claims owned by jobs it has removed
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start with awa-model/src/queue_storage.rs, especially sync_unique_claim, prune_oldest, and the truncate helper; read awa-model/src/job.rs for the default UniqueOpts behavior. Then trace enqueue handling in awa-worker/src/enqueue_specs.rs and build the real PostgreSQL lifecycle verification described in the issue. Done means pruning releases only claims owned by jobs with no remaining qualifying evidence, while preserving surviving or carried owners and passing the listed concurrency, rollback, and follow-up cases.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Assistant-generated review (Codex). Source checked on main f644f321ad110c6436382b64bdc0d935dcdeba5a and PR572 head 512f477785d327ac092b94c6a399db4a8b5c4555. This predates PR572. Native PostgreSQL reproduction was not run in this session.
Default UniqueOpts includes completed jobs (job.rs:217–237). That makes a retained completed job suppress a duplicate. But ownership survives after retention removes its final job evidence:
sync_unique_claimdeletes only when a transition leaves the configured unique-state mask. Available → running → completed stays inside the default mask.prune_oldestcarries retained failures, folds counts and truncates the ready/terminal children. Its truncate helper does not release uniqueness ownership.awa.job_unique_claimshasunique_keyandjob_id, with no FK/expiry that removes the orphan.
Source-derived minimal case:
- Enqueue a job with
UniqueOpts::default(); complete it. - Rotate/prune until its last retained job evidence is removed.
- Check that the old job is absent but its row remains in
awa.job_unique_claims. - Enqueue the same unique key again: the surviving owner can still reject it.
This matters beyond an insert error. COPY can skip a duplicate, and follow-up insertion treats the unique conflict as a duplicate under a savepoint. A later parent can therefore complete while a newly intended follow-up is suppressed by an owner whose job no longer exists.
Expected invariant: if uniqueness is scoped to retained qualifying jobs, removing a job's final qualifying evidence also releases only that job's ownership, atomically. Permanent idempotency would need a separate explicit lifetime policy. PR571's “Separate finding” already reports a local reproduction of this leak; this issue gives that finding a focused tracker rather than attributing it to PR572.
The fix must not release a claim merely because an old ready version appears in the pruned slot: the same job may have surviving live/deferred/DLQ evidence or a carried failed row elsewhere. Guard deletion by key and owner job ID, preserve carried/surviving owners, and review prune/enqueue/completion lock ordering. A sweep based only on an empty advisory lookup is unsafe.
Needed verification on PG17 and PG18: real enqueue → complete → prune → enqueue; unique staged/registered follow-ups; failed carry; retries that leave old ready versions; custom substrates; concurrent duplicate enqueue; prune rollback. Also define a guarded audit/repair procedure for existing orphan owners.
Evidence limit: source tracing plus an offline lifecycle model here, not a native final-head test or a claim that Brian ran one. Related testing umbrella: #562.
- Lenguaje dominante
- Rust
- Estrellas
- 37
- Forks
- 8
- Merge medio
- 14 h 16 min
- PR fusionados (30 d)
- 244
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de hardbyte/awa
-
feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
0.6.19 release checklistAbiertooperational
Dificultad 5/5 Más de una semana Aptitud para principiantes 8/100
hardbyte/awa#861 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
hardbyte/awa#841 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de hardbyte/awa
Issues similares
-
Mobile release verification reports missing build inputs with a custom Cargo target directoryAbiertobug good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
getsotto/sotto-authenticator#139 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
registrystack/registry-stack#2924 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
foundry-rs/starknet-foundry#4733 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100