Skip to content

1.5.0

Compare
Choose a tag to compare
@github-actions github-actions released this 29 Aug 10:09
· 1136 commits to refs/heads/develop since this release
9ac1226

Summary

In this release we are happy to add support for Idempotency InProgressExpiration timestamp.
This field is required to prevent against extended failed retries when a Lambda function times out, Powertools for AWS Lambda (.NET) calculates and includes the remaining invocation available time as part of the idempotency record.

If a second invocation happens after this timestamp, and the record is marked as INPROGRESS, we will execute the invocation again as if it was in the EXPIRED state (e.g, expire_seconds field elapsed).

This means that if an invocation expired during execution, it will be quickly executed again on the next retry.

When decorating the handler with Idempotent attribute we will do it automatically by getting the RemainingTime value from the ILambdaContext that is passed to the handler.
RemainingTime is the remaining execution time till the function will be terminated. At the time you create the Lambda function you set maximum time limit, at which time AWS Lambda will terminate the function execution.
Information about the remaining time of function execution can be used to specify function behavior when nearing the timeout.

When using Idempotent attribute on another method to guard isolated parts of your code, you must use RegisterLambdaContext available in the Idempotency static class to benefit from this protection.

Here is an example on how you register the Lambda context in your handler:

image

Lambda request timeout diagram

image

Changes

🌟New features and non-breaking changes

  • feat: Idempotency calculate remaining invocation available time as part of the idempotency record (#363) by @hjgraca

📜 Documentation updates

  • feat: Idempotency calculate remaining invocation available time as part of the idempotency record (#363) by @hjgraca

This release was made possible by the following contributors:

@hjgraca