Skip to content

anyshift-io/sre-skills / skills/sqs-queue-auditor

sqs-queue-auditor

Verified

FileKindSize
FAILURE_MODES.mdmarkdown6.6 KB
README.mdmarkdown4.9 KB
SKILL.mdskill md13.3 KB
examples/01-no-dlq.mdmarkdown2.9 KB
examples/02-dlq-retention-shorter-than-source.mdmarkdown3.3 KB
examples/03-maxreceivecount-too-low.mdmarkdown2.8 KB
examples/04-poison-ages-out-before-dlq.mdmarkdown3.9 KB
examples/05-default-visibility-short-retention.mdmarkdown3.2 KB
examples/06-public-queue-policy.mdmarkdown3.6 KB
examples/07-fifo-dedup-off.mdmarkdown2.8 KB
examples/08-clean-standard.mdmarkdown2.6 KB
fixtures/01-no-dlq/queue.jsonconfig564 B
fixtures/02-dlq-retention-shorter-than-source/dlq.jsonconfig649 B
fixtures/02-dlq-retention-shorter-than-source/queue.jsonconfig632 B
fixtures/03-maxreceivecount-too-low/dlq.jsonconfig659 B
fixtures/03-maxreceivecount-too-low/queue.jsonconfig637 B
fixtures/04-poison-ages-out-before-dlq/dlq.jsonconfig663 B
fixtures/04-poison-ages-out-before-dlq/queue.jsonconfig648 B
fixtures/05-default-visibility-short-retention/dlq.jsonconfig650 B
fixtures/05-default-visibility-short-retention/queue.jsonconfig631 B
fixtures/06-public-queue-policy/dlq.jsonconfig663 B
fixtures/06-public-queue-policy/queue.jsonconfig908 B
fixtures/07-fifo-dedup-off/dlq.jsonconfig748 B
fixtures/07-fifo-dedup-off/queue.jsonconfig804 B
fixtures/08-clean-standard/dlq.jsonconfig672 B
fixtures/08-clean-standard/queue.jsonconfig1.0 KB
tests/README.mdmarkdown4.2 KB
tests/_audit.pyscript21.8 KB
tests/_replay.pyscript720 B
tests/eval/README.mdmarkdown8.4 KB
tests/eval/eval_results.jsonconfig220.4 KB
tests/eval/judge_prompt.mdmarkdown1.4 KB
tests/eval/queues.pyscript7.6 KB
tests/eval/rubric.mdmarkdown2.6 KB
tests/eval/run_eval.pyscript11.5 KB
tests/replay_01_no_dlq.pyscript1.5 KB
tests/replay_02_dlq_retention.pyscript1.5 KB
tests/replay_03_maxreceivecount.pyscript1.3 KB
tests/replay_04_poison_ages_out.pyscript1.6 KB
tests/replay_05_default_visibility.pyscript1.8 KB
tests/replay_06_public_policy.pyscript1.4 KB
tests/replay_07_fifo_dedup_off.pyscript1.4 KB
tests/replay_08_clean_standard.pyscript1.6 KB

examples/01-no-dlq.md

View on GitHub
# Worked example 1: no dead-letter queue on a processing queue (R1)

A processing queue with no `RedrivePolicy`. Every attribute reads as healthy, the queue has messages flowing, and a poison message has nowhere to go. Fixtures and replay test under `../fixtures/01-no-dlq/` and `../tests/replay_01_no_dlq.py`.

## Scenario

- **Queue**: `payments-capture`. A worker fleet receives capture events and calls a payment processor.
- **Symptom**: one malformed capture event (a cents value the processor rejects) is received, fails, becomes visible again, and is redelivered. Forever. No alert, no DLQ, no record. After four days it is deleted by retention and nobody ever sees it.

## Step 1: parse the attributes

```
QueueArn               arn:aws:sqs:eu-west-1:211125758836:payments-capture
VisibilityTimeout      120
MessageRetentionPeriod 345600   (4 days, the default)
RedrivePolicy          (absent)
SqsManagedSseEnabled   true
```

`VisibilityTimeout` is a deliberate 120s (not the 30s default, so R5 does not fire). Retention is the 4-day default (R6 does not fire). SSE is on (R8 does not fire). The one thing missing is the `RedrivePolicy`.

## Step 2: audit the redrive path

No `RedrivePolicy` means no dead-letter queue. On a processing queue, that is **R1 (high)**. A poison message is received, fails, and after `VisibilityTimeout` becomes visible again. It is retried on every cycle for the full `MessageRetentionPeriod`, burning a consumer slot each time, and is then deleted silently. There is no quarantine and no signal. The only evidence the message ever existed is a worker that spent four days failing on it.

## Steps 3-5: lifecycle, exposure, FIFO

All clean. Visibility is deliberate, retention is the default, the queue is encrypted, there is no resource policy, and the queue is standard (not FIFO). R1 is the only finding.

## Finding

| Code | Severity | Attribute | Fix |
|---|---|---|---|
| R1 | high | `RedrivePolicy` absent | Attach a `RedrivePolicy` to a DLQ with `maxReceiveCount` in the 3-10 band, so poison messages are quarantined instead of dropped. |

## Boundary

The audit confirms there is nowhere for failed messages to go. It cannot tell you whether any message is *currently* failing: that is the redrive metric and the consumer error rate, both behind the boundary.

- Whether a poison message is in the queue right now is `ApproximateAgeOfOldestMessage` and the consumer error rate over time, not a static attribute. Join: queue to its metrics over time.
- Whether this queue is genuinely a processing queue (R1) or a buffer with an at-least-once contract elsewhere is a property of the architecture, not the queue. Join: queue to its consumers.

## Why this is the R1 reference

It is the cleanest possible R1: a single missing attribute on an otherwise healthy queue, with a failure mode (silent four-day drop of poison messages) that no console glance surfaces because every visible number looks fine.
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall