fix: quarantine poison GitHub notifications - #200
Conversation
Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
giscebot
left a comment
There was a problem hiding this comment.
The durable quarantine schema, monitor/dashboard alerting, existing-database upgrade coverage, and malformed-message continuation path are coherent, and all three GitHub checks pass. However, the reader currently quarantines every enqueue() exception on the first occurrence and then advances last_uid. This also catches transient infrastructure failures such as sqlite3.OperationalError (lock/I/O): if the immediately following quarantine write succeeds, the original notification is skipped without ever creating a job. That weakens the existing at-least-once ingestion invariant and does not match #189’s “fails repeatedly or non-transient” boundary.
Please keep transient enqueue/storage failures retryable (do not advance the high-water mark), and quarantine only errors known to be permanent, or add an explicit bounded retry/attempt mechanism before quarantine. Add a regression test where enqueue() fails transiently and verify last_uid is not advanced; the next poll must retry the notification.
Keep SQLite enqueue/storage failures retryable by letting them abort the poll before the high-water mark advances. Poison notification parsing failures still enter quarantine. Co-authored-by: giscebot <286264155+giscebot@users.noreply.github.com>
|
Addressed the requested change in
Validation:
|
|
@giscebot revisa de nou la pull-request |
giscebot
left a comment
There was a problem hiding this comment.
Revisió completada sobre b129f29.
El canvi sol·licitat queda resolt: els errors de persistència SQLite (sqlite3.Error) ja no entren a quarantena, sinó que interrompen el poll abans d'actualitzar last_uid. El nou test de regressió demostra el comportament complet: primer intent amb database is locked, high-water mark intacte, segon poll reintentat i notificació encolada sense quarantena.
També he revisat el flux complet de quarantena, la migració compatible de l'esquema per bases existents, la deduplicació per message_id, i l'exposició al monitor/dashboard. No hi veig regressions ni riscos bloquejants.
Validació:
pytest -q tests/test_reader.py tests/test_queue.py tests/test_monitor.py— 53 passedgit diff --check origin/main...HEAD— correcte- GitHub CI — dashboard, Python 3.11 i Python 3.12 verds
Nota d'entorn: la suite completa local no ha pogut ni recollir-se perquè l'entorn global no té fastapi; aquesta cobertura completa sí que està validada pels checks de la PR.
Summary
quarantined_notificationstable for GitHub ingestion failures, including UID, message id, headers, error, metadata, and a bounded body excerptlast_uidcan advance after the failure is safely recordedFixes #189.
Tests
.venv/bin/pytest -q tests/test_reader.py.venv/bin/pytest -qRisk
last_uidadvances.