AWS uses retry to perform fault tolerance. To ensure correctness under retry, functions should be idempotent (AWS lambda requires that users should write idempotent functions.
However, the function create_order is not idempotent. Specifically, if the function fails after store_order finishes and is retried, the function will invoke store_order again and create a new order. This will create multiple new orders under retry.
Please let me know if this is an idempotence bug or the function does not need to be idempotent.
AWS uses retry to perform fault tolerance. To ensure correctness under retry, functions should be idempotent (AWS lambda requires that users should write idempotent functions.
However, the function
create_orderis not idempotent. Specifically, if the function fails after store_order finishes and is retried, the function will invoke store_order again and create a new order. This will create multiple new orders under retry.Please let me know if this is an idempotence bug or the function does not need to be idempotent.