fix(destregistry): treat event format errors as failed deliveries, not DLQ#957
Merged
Conversation
…t DLQ A Format/key-template failure (e.g. an S3 key_template referencing a field absent from the event) returned a nil delivery, which the registry turned into a nil attempt and the deliverymq handler classified as a PreDeliveryError → nack → Pub/Sub DLQ. The failure was never logged, invisible to the customer, and paged us instead of surfacing as an actionable delivery error. Add destregistry.NewFormatErrorDelivery, returning a non-nil failed Delivery plus an ErrDestinationPublishAttempt, so the registry records a failed attempt, acks the message, and retries via the scheduler. The customer-facing response is a generic message; the raw Go error stays on the error for logs/telemetry and is not persisted on the attempt. Apply it across all providers with a Format step: s3, sqs, azure_servicebus, gcp_pubsub, webhook, webhook_standard (previously `return nil, err`) and kinesis, kafka (previously nil-delivery ErrDestinationPublishAttempt). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ot DLQ Standalone e2e test reproducing the production incident: an aws_s3 destination whose key_template references a field missing from the event. Asserts the fixed behavior end to end — nothing is written to S3, each delivery is recorded as a failed attempt carrying the format error, and retries run on the normal schedule and exhaust their budget rather than being nacked/dead-lettered. Verified as a real guard: reverting the destawss3 fix makes this test fail (0 attempts logged, message dead-lettered) instead of recording 3 attempts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The helper returns the (*Delivery, error) pair a publisher returns on a format failure, not just a delivery — name it accordingly. Behavior unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
alexbouchardd
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a destination fails to format a specific event (e.g. an
aws_s3key_templatereferencing a field that event doesn't have), the pipeline treated it as a system error: the message was retried blindly and eventually dead-lettered. The failure was never recorded, was invisible to the customer, and paged us — instead of being handled like any other failed delivery.What this changes
A formatting failure is now treated as a normal failed delivery: it's recorded as a failed attempt the customer can see, and it retries on the normal schedule until exhausted. No silent dead-lettering, no page.
Applied across all destination types that format events per-event.
Tests
Unit coverage plus an e2e regression (
cmd/e2e/regression_format_error_test.go) that forces a format failure and asserts it's recorded as failed attempts and exhausts retries without being dead-lettered.🤖 Generated with Claude Code