refactor: the DLQ has one retry policy, the only one that ever applied

Merged
HA
1mo ago
+31-141

Summary

The DLQ picked one of four retry policies by event type (models.py). Since #428 only the scheduler and the notification consumer save to the DLQ, and both read execution events, so every row got AGGRESSIVE_RETRY and the other three never ran. The DLQ docs still listed all four.

Changes

One RETRY_POLICY with the values that applied: 5 tries, 30 s doubling up to 300 s, 10% jitter. The pod, result and default policies, RetryStrategy, retry_policy_for and the immediate-retry branch go, plus the EXECUTION_TYPES, POD_TYPES, SECURITY_TYPES and USER_TYPES sets that only the lookup read. Retry timing for every real DLQ row stays the same.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or tooling changes

Test Plan

  • Backend unit tests pass (cd backend && uv run pytest tests/unit)
  • Frontend unit tests pass (cd frontend && npm run test)
  • Backend E2E tests pass (docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')
  • Frontend E2E tests pass (cd frontend && npm run test:e2e)
  • API spec and client regenerated if routes or schemas changed (./deploy.sh openapi, then ./deploy.sh types), never edited by hand
  • Manual testing performed

Validation: 541 unit tests pass, including a new check of the delay curve; the discard test now reads the limit from the policy. Ruff, mypy strict, the orphan check and strict mkdocs pass.

Checklist

  • My code follows the project's style guidelines
  • I have run pre-commit run --all-files and all checks pass
  • I have added tests that prove my fix/feature works
  • I have updated documentation if needed
  • My changes don't introduce new warnings

Summary by cubic

The DLQ picked one of four retry policies by event type, but since the scheduler and notification consumer are the only ones that save to the DLQ and both read execution events, every row got the aggressive policy and the other three never ran. Replaces them with one RETRY_POLICY that keeps the values that actually applied: 5 tries, 30 s doubling up to 300 s, 10% jitter.

  • Removes the pod, result, and default policies, RetryStrategy, retry_policy_for, the immediate-retry branch, and the event type sets only the lookup read.
  • Updates the DLQ docs, which still listed all four policies, and adds a unit test for the delay curve.
  • Retry timing for every real DLQ row stays the same.