You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/utilities/idempotency.md
+8-20Lines changed: 8 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -319,35 +319,23 @@ You can change this expiration window with the **`expires_after_seconds`** param
319
319
320
320
### Lambda timeouts
321
321
322
-
???+ note
323
-
This is automatically done when you decorate your Lambda handler with [@idempotent decorator](#idempotent-decorator).
324
-
325
-
To prevent against extended failed retries when a [Lambda function times out](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-verify-invocation-timeouts/){target="_blank"},
326
-
Powertools for AWS Lambda (Python) calculates and includes the remaining invocation available time as part of the idempotency record.
322
+
By default, we protect against [concurrent executions](#handling-concurrent-executions-with-the-same-payload) with the same payload using a locking mechanism. However, if your Lambda function times out before completing the first invocation it will only accept the same request when the [idempotency record expire](#expiring-idempotency-records).
327
323
328
324
To prevent extended failures, use **`register_lambda_context`** function from your idempotency config to calculate and include the remaining invocation time in your idempotency record.
If a second invocation happens **after** this timestamp, and the record is marked as `INPROGRESS`, we will run the invocation again as if it was in the `EXPIRED` state.
336
336
337
337
This means that if an invocation expired during execution, it will be quickly executed again on the next retry.
338
338
339
-
???+ important
340
-
If you are only using the [@idempotent_function decorator](#idempotent_function-decorator) to guard isolated parts of your code,
341
-
you must use `register_lambda_context` available in the [idempotency config object](#customizing-the-default-behavior) to benefit from this protection.
342
-
343
-
Here is an example on how you register the Lambda context in your handler:
0 commit comments