Skip to content

Commit ba866e6

Browse files
whummerclaude
andcommitted
Set status before starting SFN so DDB faults surface to SQS/DLQ
Without this, the SQS consumer Lambda always succeeded (SFN is async), so DDB throttle errors never caused SQS retries or DLQ delivery. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0006ddb commit ba866e6

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • 01-serverless-app/lambdas/order_processor

01-serverless-app/lambdas/order_processor/handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def handler(event, context):
5050
if "Records" in event:
5151
for record in event["Records"]:
5252
order = json.loads(record["body"])
53+
set_status(order["order_id"], "validating") # fails fast if DDB is faulted → SQS retry → DLQ
5354
sfn.start_execution(
5455
stateMachineArn=STATE_MACHINE_ARN,
5556
name=f"order-{order['order_id']}-{uuid.uuid4().hex[:8]}",

0 commit comments

Comments
 (0)