-
Notifications
You must be signed in to change notification settings - Fork 465
feat(idempotency): Remove deadlock after lambda handler timeout #1198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(idempotency): Remove deadlock after lambda handler timeout #1198
Conversation
Changes: - Initial draft on an option to clean up on function timeout close aws-powertools#1038
Codecov Report
@@ Coverage Diff @@
## develop #1198 +/- ##
========================================
Coverage 99.88% 99.88%
========================================
Files 119 119
Lines 5423 5436 +13
Branches 618 619 +1
========================================
+ Hits 5417 5430 +13
Misses 2 2
Partials 4 4
Continue to review full report at Codecov.
|
|
@heitorlessa - i added a proof of concept repo for this repo |
|
In an effort to prevent you from wasting time, you should wait for issues to prioritised, this won't be merged for a long time until we're ready to add new features. |
See issue #1038 and comment #1038 (comment) |
|
Alternative names for
|

Issue number:
Summary
Currently if a lambda times-out the idempotency dynamodb item is left in the 'INPROGRESS' status forever AND subsequent lambda retries fail with
IdempotencyAlreadyInProgressError. And thus blocking the transaction from ever completing. As a customer you would need to manually delete this pending record to retry.NOTE: This PR solves this for a AWS Lambda function handler with a
idempotentdecorator, but not yet foridempotent_functionas we don't have a direct handle to the Lambda context.Changes
Please provide a summary of what's being changed
Initial draft on an option to clean up on function timeout
Changes:
function_timeout_clean_upwhich will cleanup in complete record in the previous invoke times outsave_inprogresssets afunction_timeoutiffunction_timeout_clean_upis true_put_recordnow includes anOR #function_timeout < :nowto allow for overriding after function timeout_update_recordresetsfunction_timeoutback toNoneafter completing a functionUser experience
Add an optional flag
function_timeout_clean_upto clean up on retries if the function timed outExample usage of a lambda that times out before completing ie:
time.sleep(3)Example sam template with this PRs powertools as a layer and a timeout of 2 seconds
First call will timeout writing the
function_timeoutrecord of when to expireSecond call would override / cleaning up the previous call
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
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.