Non-idempotent tasks with retries cause duplicate processing and data corruption
criticalconfigurationUpdated Nov 21, 2025(via Exa)
How to detect:
Retrying non-idempotent tasks leads to duplicate processing, causing data corruption in 25% of cases. Examples include double charges in payment processing. Without message ID tracking and deduplication, retries execute the same operation multiple times.
Recommended action:
Always chain idempotency middleware before retry middleware. Implement Redis-based message ID tracking with SCAN for msg_id lookup. Use Redis SETEX with 24-hour TTL to deduplicate messages. Add supplier_tx_hash for transaction-level deduplication. Log with structlog for audit trail.