Skip to content

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

Merged
HardMax71 merged 1 commit into
mainfrom
max/dlq-one-retry-policy
Oct 22, 2026
Merged

HardMax71 merged 1 commit into
mainfrom
max/dlq-one-retry-policy

Conversation

@HardMax71

@HardMax71 HardMax71 commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

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.

Written for commit dc6f52a. Summary will update on new commits.

View guided diff Turn on auto-fix

Since #428 only consumers of execution events save to the DLQ, so every row got AGGRESSIVE_RETRY. The pod, result and default policies, the strategy enum, retry_policy_for and the event type groupings only it read go; the policy keeps the same values: 5 tries, 30 s doubling up to 300 s, 10% jitter.
@HardMax71
HardMax71 enabled auto-merge (squash) October 22, 2026 11:51
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c193e605-03c1-45cf-bba0-5d0803301f1d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area: events Kafka consumers and middlewares, producer, idempotency, DLQ, replay labels Oct 22, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov-commenter

codecov-commenter commented Oct 22, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
backend-e2e 82.22% <100.00%> (+0.04%) ⬆️
backend-unit 77.36% <100.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
backend/app/dlq/__init__.py 100.00% <ø> (ø)
backend/app/dlq/manager.py 97.43% <100.00%> (+1.13%) ⬆️
backend/app/dlq/models.py 100.00% <100.00%> (+8.45%) ⬆️
backend/app/infrastructure/kafka/topics.py 100.00% <ø> (ø)

... and 2 files with indirect coverage changes

Components Coverage Δ
Backend 94.39% <100.00%> (+0.08%) ⬆️
Frontend 92.11% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HardMax71
HardMax71 merged commit 3f81b66 into main Oct 22, 2026
22 checks passed
@HardMax71
HardMax71 deleted the max/dlq-one-retry-policy branch October 22, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: events Kafka consumers and middlewares, producer, idempotency, DLQ, replay documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants