Silent AWS Lambda Bug Causes Duplicate Order Processing Despite Correct Code
A subtle misconfiguration in AWS Lambda's SQS event source mapping can cause entire message batches to be redelivered even when only one record fails, leading to duplicate processing. The issue arises when a Lambda handler correctly builds a partial batch failure response, but the event source mapping lacks the ReportBatchItemFailures setting, causing Lambda to silently discard the return value. Because the bug lives in infrastructure configuration — not application code — it is invisible to linters, unit tests, and code reviewers. AI coding assistants are equally blind to the problem, since they can only see the handler code and not the separate Terraform or CDK configuration that controls delivery semantics. In non-idempotent systems, the failure mode can result in real-world consequences such as customers being charged multiple times.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in