feat(python/robomp): added automatic event retry scheduling with backoff delays

- Added event retry settings with parsed delay schedules and jittered delay computation.
- Extended event persistence to persist an `available_at` timestamp, honor it during dequeuing, and clear it when re-queuing.
- Updated worker failure handling to queue bounded retries with backoff and transition to failed only when the retry budget is exhausted.
This commit is contained in:
can1357
2026-06-14 09:15:18 +02:00
parent 4a2417c92f
commit 46ea12f1a1
6 changed files with 318 additions and 7 deletions
+2
View File
@@ -161,6 +161,7 @@ async def test_non_cancelled_failure_keeps_real_traceback(
) -> None:
"""A garden-variety dispatch failure still records the traceback path."""
pool = _make_pool(settings, db)
monkeypatch.setattr(settings, "event_max_retries", 0) # assert terminal failure, not retry
db.record_event(
delivery_id="d4",
event_type="issues",
@@ -191,6 +192,7 @@ async def test_run_event_marks_failed_when_not_shutting_down(
) -> None:
"""When `_shutting_down` is False, a dispatch failure still marks the row failed."""
pool = _make_pool(settings, db)
monkeypatch.setattr(settings, "event_max_retries", 0) # assert terminal failure, not retry
assert pool._shutting_down is False # noqa: SLF001
db.record_event(
delivery_id="d5",