feat(idempotency): Allow durable functions to replay #7764
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Issue number: fixes #7762
Summary
This PR adds support for durable functions in the Idempotency utility.
is_replayvariable. We use this to determine if a function is being replayed.Changes
is_replayparameter to thehandlemethodDurableContextclassUser experience
Idempotency utility now allows durable functions to execute after suspension.
Notes
This leaves one issue remaining in the idempotency utility when used with durable functions.
We use
context.getTimeInMillis()to calculate the expiry time of theINPROGRESSstatus. Duplicate payloads received after that expiry time will be allowed. In a durable execution, the length of the workflow can be up to 1 year, across multiple lambda invocations. This is longer than the maximum 15 minutes that anINPROGRESSstatus can currently have. Idempotency records for long running workflows will not be protected from duplicate invokes beyond the first 15 minutes of their life.In future, we could
DurableContext.getExecutionTimeoutInMillis()method. Once this is added, we can calculate the workflow timeout in the same manner we do for a single invocation.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.