Suppress a confirmed invalid destination before replaying a freight notification job. Recover the remaining recipients individually. Yahoo’s sender guidance supports removing invalid recipients; for queue recovery, the operational consequence is to make suppression part of the dispatch decision rather than leave it as a report someone reads after the next bulk send.
TL;DR: Investigate a stuck batch through a recipient ledger. Separate job execution from delivery evidence, reconcile uncertain submissions, and retry only eligible recipients. A bounce should prevent another attempt to that destination without blocking unrelated shipment alerts.
Consider a proposed logistics workflow that sends shipment exception notices by email and SMS. A dispatcher needs to know which consignee can still receive an alert after a partial failure. The useful recovery question is specific: which destination is safe to contact next, and what evidence supports that decision? A green worker dashboard cannot answer it alone.
This runbook treats incident containment as the organizing problem. Delivery reliability is the decision criterion, but the work begins with narrowing the replay scope and ends with a reversible release. All counts and identifiers below describe an illustrative test fixture, not production measurements.
How should recipient status guide a stuck email and SMS batch?
Start with the oldest unresolved recipient record. Compare its last state transition with the worker attempt and the latest delivery evidence. Treat an empty or ambiguous status as an investigation target. It is not permission to send again.
Use a 6-record fixture for the investigation: 2 accepted submissions awaiting final evidence, 1 confirmed email delivery, 1 email address reported invalid, 1 SMS destination reported invalid, and 1 attempt whose submission outcome is unknown. These are application classifications for this exercise. Map external responses into them only after checking the sending integration’s documented meanings; email bounce terminology must not become an assumed SMS status contract. The batch now has several different recovery needs. Replaying all 6 records would deliberately include a completed delivery and 2 known invalid destinations. Replaying just the unknown attempt could still create a duplicate if the earlier submission succeeded but its acknowledgment was lost. Waiting for every record to become delivered, meanwhile, gives the invalid destinations no sensible terminal state. The aggregate can stay unresolved even when the queue worker has finished its assigned work.
Keep those boundaries visible.
For this design, distinguish queue execution, submission acceptance, and destination outcome. A finished task means the worker completed its local responsibility; define that responsibility explicitly. An accepted submission should remain separate from a confirmed delivery. Also record whether a recipient is suppressed, since suppression determines future eligibility even after the current attempt becomes terminal.
The first incident note should name the affected shipment event, recipient channels, oldest unresolved transition, and evidence still missing. Avoid closing the incident with “the queue drained.” That observation describes worker progress, while the incident concerns whether eligible consignees received their notices.
Contain invalid destinations before recovering the batch
Pause automatic replay for the affected scope while preserving inbound delivery evidence. In the recipient ledger, retain the event identifier, destination identifier, channel, attempt identifier, external submission identifier when available, and the reason for the current classification. Store evidence timestamps separately from processing timestamps so the investigation can distinguish a late report from a recent send.
Apply suppression only when the evidence supports that scope. A confirmed invalid email address should suppress that email destination. It should not silently suppress the consignee’s phone number or every contact at the same freight customer. For SMS, require a documented invalid-destination result before making the equivalent change. Keep temporary failures and uncertain outcomes outside the permanent-invalid category.
Yahoo’s guidance on invalid recipients supports the email hygiene decision. It does not define the behavior of an SMS integration, a queue, or an application’s cross-channel fallback. Those boundaries belong in the recovery procedure.
There is a deliberate trade-off here: narrower suppression preserves reachable contacts, but it requires destination-level records and an explicit correction process. Broad customer-level suppression is easier to implement and harder to justify when only one address failed. For freight exceptions, the additional bookkeeping buys a more precise answer about who still needs an alert.
A corrected contact must enter a reviewed recovery path. Keep the evidence for the old destination, associate the replacement with the intended recipient, and check whether the original shipment alert is still relevant before dispatching it. Otherwise, repairing an address can accidentally release stale notices.
Put the eligibility check beside the send decision
Use one logical intent per shipment event, destination, and channel. Give each transport attempt its own identity, but preserve the intent identity across retries. This is an application design rule: it lets reconciliation distinguish another attempt at the same notice from a new business event.
The following Go example implements only the eligibility decision. Its records are application-owned classifications, not external API fields. The caller must load current state under the same claim mechanism used to reserve dispatch work.
package alerts import "errors" type State string const ( Ready State = "ready" Accepted State = "accepted" Delivered State = "delivered" Invalid State = "invalid" Unknown State = "unknown" ) type Recipient struct { IntentID string Channel string Suppressed bool State State } func Eligible(r Recipient) (bool, error) { if r.IntentID == "" { return false, errors.New("missing intent identity") } if r.Channel != "email" && r.Channel != "sms" { return false, errors.New("unsupported channel") } if r.Suppressed { return false, nil } switch r.State { case Ready: return true, nil case Accepted, Delivered, Invalid: return false, nil case Unknown: return false, errors.New("reconcile submission before retry") default: return false, errors.New("unrecognized recipient state") } } This predicate does not provide atomic dispatch or exactly-once delivery. Two workers could both observe a ready record unless the surrounding implementation coordinates claims. A suppression update could also arrive between a read and a submission. Specify how the dispatcher and suppression writer serialize their decisions, and document what happens to submissions already in flight. No local state change can retract a message that has already left the system.
Persist the attempt identity before submission.
If the result becomes uncertain, reconcile through whatever status lookup or delivery evidence the integration actually supports. Don't assume every transport offers an idempotency key, recipient polling, or the same retention period. Where duplicate prevention is documented, verify its scope and lifetime before relying on it. Where evidence cannot resolve an uncertain attempt, keep the exception visible for an explicit operational decision.
For polling, select unresolved attempts individually. Use a bounded schedule and stop according to a documented resolution policy. Polling a parent batch forever will not repair a missing recipient transition. Record when the next check is due and what evidence would close the record, so an operator can distinguish scheduled waiting from abandoned work.
Template checks belong before dispatch eligibility becomes send work. The Mustache manual specifies that a missing variable renders as an empty string by default. If a shipment identifier or callback detail is required by the application, validate it before rendering and submitting. An empty rendered field should produce a content-validation failure in this design, not a destination suppression entry. That distinction keeps a template defect from poisoning the recipient ledger.
Verify recovery with a bounded replay
Run the 6-record fixture through the recovery decision before enabling replay. Expect no immediate submissions: the accepted records need evidence, the delivered record is complete, invalid destinations are ineligible, and the unknown attempt needs reconciliation. Then add 1 explicitly ready recipient and expect exactly 1 dispatch claim. These counts are test expectations, not a delivery guarantee.
Exercise the transitions that usually disappear inside a happy-path test. Deliver the same invalid-recipient report twice and check that suppression remains a single effective decision. Process an older acceptance report after a terminal invalid result and verify that the selected state policy does not reopen dispatch eligibility. Run two workers against the added ready recipient and verify that only one obtains the active claim. Finally, simulate a submission timeout and confirm that the record enters reconciliation instead of immediate replay.
Test the boundary.
In particular, inject suppression while a worker is preparing a send. Confirm the implemented serialization behavior and record the remaining in-flight exposure. A successful unit test of the predicate cannot establish that property; it requires an integration test around claims, persistence, and dispatch.
For release, start with a bounded set of affected intents and inspect every resulting transition. Observe unresolved-recipient age, suppression decisions by reason and channel, active claim age, and repeated attempts for the same intent. Keep recipient addresses and phone numbers out of routine metric labels; use restricted ledger access for destination-level investigation.
Worker throughput is supporting evidence. The release criterion is that eligible work progresses while invalid, completed, and uncertain records follow their defined paths.
Roll back dispatch without erasing the evidence
If replay produces unexpected submissions, stop new dispatch claims for the affected scope first. Preserve delivery evidence ingestion and reconciliation where they can run safely. Roll back the dispatch change while retaining suppression records, attempt identities, and terminal outcomes. Removing those records would make the next recovery decision less informed.
After containment, compare the affected intents with their recorded attempts. Separate confirmed duplicate submissions from suspected duplicates, and identify the exact eligibility or claim transition that permitted each one. Reopen dispatch only after the fixture and concurrency checks reproduce the intended behavior. For the next freight alert, the operating rule remains concrete: a known invalid destination stays suppressed, an uncertain submission gets reconciled, and every replay has a recipient-level reason.
References
- Yahoo: Sender best practices and requirements — https://senders.yahooinc.com/best-practices/
- Mustache template syntax manual — https://mustache.github.io/mustache.5.html