Skip to content

feat(DLQ): implement Dead Letter Queue (DLQ) #4

Merged
faranjit merged 4 commits intomainfrom
feature/dead-letter-queue
Jan 12, 2026
Merged

feat(DLQ): implement Dead Letter Queue (DLQ) #4
faranjit merged 4 commits intomainfrom
feature/dead-letter-queue

Conversation

@faranjit
Copy link
Copy Markdown
Owner

Summary

This PR implements the full Dead Letter Queue (DLQ) feature to handle permanently failed jobs, preventing them from clogging the active queue.

Key Changes

  • Backend Logic:

    • Created execution_dlq table to isolate jobs that exceed the max retry limit.
    • Added logic to transactionally move failed jobs to DLQ and resurrect them upon request.
  • API:

    • Created GET /executions/dlq to list failed jobs.
    • Created POST /executions/dlq/{id}/retry to retry a specific job.
  • CLI:

    • Added jobctl dlq list command to inspect the queue.
    • Added jobctl dlq retry <id> command to manually retry jobs.

- Add execution_dlq table with job metadata
- Move failed executions to DLQ after max retries
- Add ListDLQ and RetryFromDLQ store methods
- Add GET /executions/dlq and POST /executions/{id}/retry endpoints
- Track retry lineage via retried_from column
- Move ListDLQ and RetryFromDLQ into JobStore interface
- Remove separate UserStore interface
- Clean up handler store embedding
- Add 'dlq list' and 'dlq retry' commands to CLI
- Add client methods for DLQ endpoints
- Fix: ensure retried executions use UTC timestamps in Postgres
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 74.54545% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.37%. Comparing base (54e1fe1) to head (9c4bc1a).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
cmd/cli/cmd/client.go 50.00% 10 Missing and 8 partials ⚠️
internal/store/postgres/execution.go 80.55% 7 Missing and 7 partials ⚠️
internal/controller/handlers/executions.go 77.77% 8 Missing and 4 partials ⚠️
cmd/cli/cmd/dlq.go 83.33% 5 Missing and 3 partials ⚠️
internal/controller/server.go 0.00% 2 Missing ⚠️
internal/store/postgres/queue.go 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #4      +/-   ##
==========================================
- Coverage   65.78%   65.37%   -0.42%     
==========================================
  Files          33       35       +2     
  Lines        1555     1961     +406     
==========================================
+ Hits         1023     1282     +259     
- Misses        466      587     +121     
- Partials       66       92      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@faranjit faranjit merged commit c1c5634 into main Jan 12, 2026
5 of 6 checks passed
@faranjit faranjit deleted the feature/dead-letter-queue branch January 12, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant